1.0.1 • Published 2 years ago

rpcm-root-require v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

rpcm-root-require

Very simple extension to the module "app-root-path" (all credits to the author)

Require the app files without the the need of knowing the root folder, just add the relative path to the script.

The module also provides a property with the root path.

Install

npm install --save app-root-path
npm install --save rpcm-root-require

Usage

const rootRequire = require("rpcm-root-require");
const myModule1 = rootRequire("folder1/module1");
const myModule2 = rootRequire("another-folder/module2");

const rootPath = rootRequire.rootPath;