node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Sidewalk allows you to require a module into a separated process, and interact with it seamlessly. Multi-processing has never been this easy!


$ npm install sidewalk
const sidewalk = require("sidewalk");


Heres a side by side comparison of require and sidewalk:

  1. Suppose you have a module calc.js

    // calc.js 
    exports.add = function(x, y, callback) {
        callback(null, x + y);
  2. Use require to load it into the current process

    const calc = require("./calc.js");
    calc.add(1, 2, function(err, result) {
  3. Or use sidewalk to load it into a separated process

    const calc = sidewalk("./calc.js").expose(["add"]);
    calc.add(1, 2, function(err, result) {


  • Sidewalk uses the built-in JSON based IPC, so it can NOT pass functions, regexes, errors, etc.

  • Remember to expose the method names first, or use the exec(func, arg1, arg2, ..., [callback]) API instead.

    Theres no wildcard getters without using the --harmony flag, we might switch to a ES6 Proxy implementation later, and forget about the expose!



                    Version 2, December 2004
 Copyright (c) 2016 Yichao 'Peak' Ji
 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.