ReQuireFrom (rqf)
Advanced require module for node.js. Removes the need for complex relative paths for require statements. Inspired by requirefrom module and the discussion here.
Installation
npm install rqf
Sample
var rqf = ; var lib = ; var sampleLib = ;
Usage
rqf allows unlimited nesting and the same api regardless of depth. It doesn't require configuration and by default computes the root path from your node_modules directory. If you rather want to use the current working directory use
var rqf = ; rqfbase = rqf;
Please refer to the following examples
// define rqf var rqf = ; // require sample from root directory var fromRoot = ; // require sample from lib directory var fromLib1 = 'sample'; // require sample from lib directory var lib = ; var fromLib2 = ; // use current working directory as base var lib = rqf var fromLib3 = ; // nesting modules var sample = lib; var fromLibSample = ;