-3

I would like to make a Node js application that runs locally in every machine regardless of Operating System used. For example, if I build a To Do listing application in node js, when I type www.todo.app in a browser, the To Do application should run. I tried Electron Js to make application, but the problem is that, it takes extra memory in machine. I know Electron runs with the inbuilt chrome browser. If I have already installed chrome browser in the machine, why should Electron install another chrome in that machine.

So, my question is, if I have any opportunity to do a node js application that runs locally in a machines browser.

  • So, you basically need to build a website? That's client-side Javascript. Node JS is a runtime that can execute Javascript code and provide access to native OS features such as filesystem, sockets, processes, etc. You obviously won't have access to those resources in the context of a web site (web application) but you can use Javascript to build an interactive application, fetch data, save it on the client-side storage, etc. But it won't be a Node JS application, it'll simply be a Javascript application, loaded via an HTML page. – Arash Motamedi Feb 11 '18 at 07:18
  • not actually a website. I like to write a web application that runs in client-side offline. If a user turns on his pc, open a browser, type www.todo.app, the application should work without the internet connection. I would like to use node js for accessing and modifying files. If I type node server.js in command prompt, node js server starts to run. But I do not want my users to open command prompt and type node server.js to run todo application. As the pc starts, the server.js should also start. – Jeffrin John Feb 11 '18 at 08:01
  • 1
    Ok there's just a lot to what you want to accomplish, and I'm not sure about your prior experience deploying client applications. Your best bet is still Electron as it encompasses so many of the components that you'd otherwise need to build and deploy manually: installer, updater, node runtime, etc. So, if you're new to all this, I'd say stick to Electron and don't worry about what you deem to be memory overhead. It's practically like opening another Chrome tab, so not a big deal. Not sure if Electron supports installing agents that run on machine startup, but you can research that. – Arash Motamedi Feb 11 '18 at 08:06
  • Great applications, such as Visual Studio Code, are built and deployed using Electron, so it's a worthy tool and should satisfy most of your needs and help you get started quickly and with ease. – Arash Motamedi Feb 11 '18 at 08:08

1 Answers1

0

There are simply too many questions here.

I tried Electron Js to make application, but the problem is that, it takes extra memory in machine.

While the memory consumption of electron application is usually larger than highly optimized native applications, it is comparable to running chrome standalone. So switching from electron to a node based application (which user would need to run locally) does not save you a lot in terms of memory esp if the user uses chrome to view the web application.

If I have already installed chrome browser in the machine, why should Electron install another chrome in that machine.

Basically, bundling the runtime ensures that you can control the version of chrome in use in your application regardless of what the user has installed in his/her machine.

This also means that the browser engine you test against, is the browser engine that the user uses (on all platforms).

Some projects like electrino have attempted to address this by using the installed browser engine for electron like desktop applications, but as far as I know none of these efforts are production ready yet.

So, my question is, if I have any opportunity to do a node js application that runs locally in a machines browser.

Having said all of the above, there is nothing really preventing you from building and distributing a node based web applications.

For application targeted at technical (or technically inclined) users people usually distribute these applications either as npm packages or platform specific package managers (eg. scoop for windows, homebrew for mac, snaps for linux etc.).

You can also use a solution like zeit's pkg to distribute your application as a standalone binary.

As far as I can tell, any app store for desktop operating systems will not allow distribution of web applications.

lorefnon
  • 12,875
  • 6
  • 61
  • 93