Make your app modular
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
index.js
package.json

README.md

node-addon

Make your app modular

Usage

var addon = require('addon');

var app = {};

addon.call(app, __dirname + '/plugins/*.js');

app.hello();

// console output
hello, anonymous

In plugins/hello.js:

module.exports = function helloPlugin() {
  var app = this;
  app.hello = function (name) {
    console.log('hello, ' + name || 'anonymous');
  };
};