Socket
Socket
Sign inDemoInstall

include-path

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    include-path

Inject additional paths to modules.require global search path.


Version published
Maintainers
1
Install size
4.40 kB
Created

Readme

Source

node-include-path

Inject additional paths to modules.require search path directly in node. This module uses a minimalist approach, manipulating the process.env key NODE_PATH and re-calling the module.js init function.

Install the package. $ npm install include-path

Usage: module([paths])

/*
 *  file server.js
 *
 *  require a path
 *  require('include-path')('./lib');
 *
 *  or alternately
 *  require('include-path')(__dirname+'/lib');
 *
 *  or an array
 *  require('include-path')(['./lib', './library', './extra']);
 */

require('include-path')('./lib');

var myLocalModuleFromLibDirectory = require('myLocalModuleFromLibDirectory');


All tests pass with node -v v0.10.28 All tests pass with node -v v0.10.29

Keywords

FAQs

Last updated on 30 Jul 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc