r/learnjavascript • u/ConnectAffect2346 • 5d 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
11
Upvotes
7
u/IAmTheRedditBot 5d ago
Electron could be smth for you
5
u/Icy-Taste-3096 5d ago
Electron was made for exactly this purpose
9
u/Dazzling_Music_2411 5d 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.
4
u/realmauer01 5d 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.
4
u/Discordbothost 4d 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.
1
u/xxcrucialxx 5d 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/LucVolders 4d 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/CuAnnan 2d ago
Wrapping my head around functions returning functions let me do great things with my Controllers
2
u/traplords8n 5d 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.
1
u/wbport1 5d 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/TheRNGuy 4d ago
I'd recommend React with TS instead of vanilla JS.Â
0
u/MauriceM7 5d 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
-1
u/SoMuchMango 5d ago edited 4d 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.