Install this
$ npm install lib
to replace this
var fs = require('fs'),
util = require('util'),
http = require('http'),
path = require('path'),
mymodule = require('./mymodule'),
mymodule2 = require('./mymodule2'),
foo = require('./foo');
with this
var lib = require('lib')('mymodule','mymodule2','foo');
Tell me more.
Node natives as well as the specified modules are added to the lib
object as enumerable properties and loaded on first use.
lib.util.print('Wow!');
There is no performance overhead, no namespace conflicts, and your code stays nice and compact.
Credit to kof and his node-natives module. This is MIT licensed.