npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

electronify-server

v0.6.2

Published

electronify-server is a tool which presents local web servers in an Electron shell.

Downloads

25

Readme

electronify-server

electronify-server is a lightweight tool which starts a local web server and opens a url in an Electron shell.

Installation

npm install --save electronify-server

How does it work?

When the Electron app loads, electronify-server will start a child process with the command you gave it in the configuration. This command is assumed to be a web server (but it doesn't have to be). If the child process was started successfully, the window will open and load the url to your server.

Examples

There are a couple examples included in the repo. In order to run the examples, you need to have electron installed. If you do not have it installed, perhaps the simplest way is to use electron-prebuilt like so:

npm install -g electron-prebuilt

To run the examples, simply go into each example folder and run:

electron .

The static example has a dependency that will need to be installed first via:

npm install

Short Example

var electronify = require('electronify-server');

electronify({
  url: 'https://google.com',
  noServer: true
});

Long Example

var electronify = require('electronify-server');

electronify({
  command: 'python -m SimpleHTTPServer',
  url: 'http://127.0.0.1:8000',
  debug: true,
  window: {height: 768, width: 1024},
  ready: function(app){
    // application event listeners could be added here
  },
  preLoad: function(app, window){
    // window event listeners could be added here
  },
  postLoad: function(app, window){
    // url finished loading
  },
  showDevTools: false
}).on('child-started', function(child) {
  // child process has started
  console.log('PID: ' + child.pid);

  // setup logging on child process
  child.stdout.on('data', console.log);
  child.stderr.on('data', console.log);

}).on('child-closed', function(app, stderr, stdout) {
  // the child process has finished

}).on('child-error', function(err, app) {
  // close electron if the child crashes
  app.quit();
});

Configuration Options

  • url [String]: URL to load after child process starts
  • command [String]: command to start child process
  • options [Object]: options for exec
  • debug [Boolean]: enables debug output
  • noServer [Boolean]: allows urls to load without starting a child process
  • showDevTools [Boolean]: shows dev tools on startup
  • window [Object]: BrowserWindow configuration
  • ready [Function]: called when the application is ready
    • app [Object]: Electron application
  • preLoad [Function]: called after the window is created but before the url is loaded
    • app [Object]: Electron application
    • window [Object]: Electron BrowserWindow
  • postLoad [Function]: called after the url has finished loading
    • app [Object]: Electron application
    • window [Object]: Electron BrowserWindow

Relevant documentation

Events

electronify also returns an EventEmitter which emits several events for the child process. This allows you to do additional work when the child process starts, exits or fails unexpectantly.

  • child-started: Emitted immediately on successful start of child process
  • child-closed: Emitted when the child process exits gracefully.
    • app: Electron application
    • stderr: Standard error of child process
    • stdout: Standard output of child process
  • child-error: Emitted when the child process fails.
    • err: Error returned from executing child process.
    • app: Electron application
  • error: Configuration error
    • err: Configuration error
    • app: Electron application