Running JavaScript app outside of the browser

Travis Tubbs picture Travis Tubbs · Mar 4, 2016 · Viewed 14k times · Source

I have a couple of little widgets that I have made to run in the browser, just basic JavaScript and HTML. They are little tools that have blank backgrounds and things like CPU usage, and just little toys like that.

I originally developed these tools to live on a web page as components of a view on a web site. Is there a way that I can bring these outside the browser such as Chrome, and just have my CPU usage app overlay my desktop so I can still see stuff behind it such as when a movie is playing, or playing a video game? Perhaps even launch a javascript only program that runs AS A DESKTOP application?

It is fine to depend on the browser as long as I can have this app over my desktop or run as a stand alone Node.js application. How is this done? I recently heard that desktop applications such as Discord do things much like this with voice comms and have overlays in games.

Answer

MrHaze picture MrHaze · Mar 4, 2016

As a website, the answer is no. However you can create a Node app, and that can run as a normal executable.

I believe Spotify, and Slack (at the time of writing) are good examples of a Node wrapped application.

A few options:

These project have some serious star counts on github.

Electron

The Electron framework lets you write cross-platform desktop applications using JavaScript, HTML and CSS. It is based on Node.js and Chromium.

Github's Atom editor is built using Electron.

Slack uses Electron as well.

Electron's official site

node-webkit

NW.js is an app runtime based on Chromium and node.js. You can write native apps in HTML and JavaScript with NW.js. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies.

The unofficial Facebook Messenger for Desktop is built using node-webkit.

Other cool projects: