rpcm-root-require

Source:

Module that returns the root folder of the project

This is essential when calling for project modules.

This simple module helps you access your application's root path from anywhere in the application without resorting to relative paths like require("../../path").

Find full module documentation here: https://www.npmjs.com/package/rpcm-root-require

Example

const rootRequire = require('rpcm-root-require');
const otherModule = rootRequire('/platform-helpers/other-module');

// also provides the project root path
var rootPath = rootRequire.rootPath