Dead-stupid init.d-like plugin manager for node.js
Dead-stupid init.d-like plugin manager for node.js.
$ npm install jsplugs
Returns a jsplugs object that contains plugs.
Loads plugs into the jsplugs object.
Returns a hash of all the plugs loaded, in order. Each plug has an ordinal. Ordinals are a numeric prefix
to plug filenames (e.g. the ordinal of
010.xyz.js is 010). Files without an ordinal are always last.
This example shows how to use jsplugs to plug in middleware into an express server. jsplugs fits well here because it supports ordering using ordinal prefix.
Given the directory structure:
var express = ;// create an instance of `jsplugs` and load all the plugs under ./middleware// now middleware contains an ordered hash of all the plugs and their require()ed payload.var middleware = ;var server = express;for var mw in middlewareconsole;server;server;
$ node express.js & 65761using authusing logusing appusing errorsusing cors$ curlin authin login appin errors