reroot
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

ReRoot

This library is designed to limit the require path in the specific directory

Intall

npm install reroot

Usage

// Where the cloest node_modules is
require('reroot').project_root;

// Assign where does the root '/' start from
require('reroot').search_root = "/PATH/YOU/WANT/ALL/MODULES/START";

// other module
require('/a/b/c'); // This will be resolved into "/PATH/YOU/WANT/ALL/MODULES/START/a/b/c"

// If you really wanna require files other than the the path specified
require('file:///PATH/TO/OTHER/SCRIPT');

Readme

Keywords

Package Sidebar

Install

npm i reroot

Weekly Downloads

0

Version

1.5.1

License

ISC

Unpacked Size

5.38 kB

Total Files

4

Last publish

Collaborators

  • jcloudyu