It makes loading local project lib node_modules easier.
In package.json, you can do...
"libs": "https://github.com/wookets/node-libs/0.4.0"
var libs = require('libs');
libs.directory('./lib'); // loads everything in this directory into the libs, only need to call once
libs.sessionManager() // assuming this exists in {directory}/sessionManager.js
libs.routeChecker() // assuming this exists in {directory}/route-checker.js
libs.routes // assuming this exists in {directory}/routes/index.js and you have an index file
With coffeescript (or Harmony destructuring)
{sessionManager, routeChecker, routes: {helper}} = require('libs')
- added a directory method so you can set load a directory or many directories if needed
- removed recursion, because let's keep things simple and you lib should be decently flat anyway
- Usage changed.
- libs returns an array now, so that you can rename cough lodash cough