Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lib

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib

Require all of your modules on one line

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
119K
decreased by-5.06%
Maintainers
0
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 16 Jan 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc