JSPM

  • Created
  • Published
  • Downloads 4203
  • Score
    100M100P100Q106365F

Require all of your modules on one line

Package Exports

  • lib

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.