r/learnjavascript • u/ConnectAffect2346 • 1d ago
Advanced javascript?
So i am a student whom enjoys making various small projects in free time with few languages but i have been wondering, as i have used javascript to make few static websites, and programs since it was very interesting to try and as javascript has a lot of built in functions and elements that allow various ways to solve problems, is there a way to make desktop applications using javascript and how precisely? Please explain, even a hint would be useful
10
Upvotes
8
u/Dazzling_Music_2411 1d ago
The whole point of using JavaScript is to take advantage of its wonderful graphics capabilities IN THE BROWSER. IOW, JS "desktop" applications are just web pages. You have probably seen loads of them, even if you didn't realize it at the time. Spreadsheets, language IDEs, games, graphics programs like Desmos. etc. etc...
The Web pages don't have to run on the WWW. They can be served locally from your own computer if you wish.
Using Javascript only as a backend, as others have said, won't allow you to make impressive displays, although, of course, you can still use it for normal computing - it just won't look like much.
6
u/IAmTheRedditBot 1d ago
Electron could be smth for you
5
u/Icy-Taste-3096 1d ago
Electron was made for exactly this purpose
1
u/xxcrucialxx 1d ago
What other kinds of projects with what languages have u done, if I may ask? Sorry, u made me a little curious....lol
3
u/traplords8n 1d ago
It's really not the tool for the job. I think you CAN create some sort of desktop program with node, but it's built to be a backend and i'm sure it's way more complicated than using a language like python instead of javascript.
3
u/realmauer01 1d ago
Electron is pretty much what you want. Its practically bundleing your code with a browser and then that browser showing just that one website that your code produces.
2
u/Discordbothost 22h ago
Try the Electron first-app tutorial with one of your static sites. In the example, point loadFile at your own index.html, then run npm start and see if an existing button still works. You can do that first pass with the HTML, CSS and JS you already wrote.
2
u/LucVolders 22h ago
You can turn a Javascript program with some HTML and CSS into a "stand alone" program that works offline.
It does use the browsers enigine but it runs in its own window.
This is called a PWA (progressive Web App). There is actually a lot of fuzz around this but in fact it is very easy.
Web apps can have their own icons (just like any program) and when written well they can be run on Android, Iphone, Windows, Linus and IOS computers. Write once: run everywhere.
If you want to read more about this you can check my website:
https://lucstechblog.blogspot.com/2026/11/web-apps-explained.html
2
u/TheRNGuy 20h ago
I'd recommend React with TS instead of vanilla JS.Â
1
u/wbport1 1d ago
You can avoid the browser by putting .hta instead of .html at the end of a file you keep on your desktop. It will have a simpler display and may not have debug features.
1
u/MauriceM7 1d ago
Don't use Javascript. Do the horses for courses. Javascript is for the browser. So essentially you would have to have browser embedded in a desktop framework. You could do the node thing if you dont want ui. But I would say if you want to write desktop apps then use the appropriate language as Javascript is not suited for it
0
u/SoMuchMango 1d ago edited 22h ago
Wait what? JavaScript has relatively small amount of builti-in functions. Web platform is quite nice, browser has a lot of APIs to do certain stuff, but language features are kinda limited. It's much better right now, but f.e. Python is a much richer language.