budibase/packages/standard-components/node_modules/require-relative
Martin McKeaveney 990882f9db allow configuration of redis cluster with fully qualified redis URL 2021-09-09 17:14:24 +01:00
..
README.md allow configuration of redis cluster with fully qualified redis URL 2021-09-09 17:14:24 +01:00
index.js allow configuration of redis cluster with fully qualified redis URL 2021-09-09 17:14:24 +01:00
package.json allow configuration of redis cluster with fully qualified redis URL 2021-09-09 17:14:24 +01:00

README.md

require-relative

require-relative is a node.js program to require and resolve modules relative to a path of your choice. It exploits node.js's own module module, and has no additional dependencies.

Example

requiring modules relatively

var relative = require('require-relative');

var someModule = relative('./some-module', '/home/kamicane');
var somePackage = relative('some-package', '/home/kamicane');
var isTrue = relative('./some-module.js', process.cwd()) === relative('./some-module.js');

resolving filenames relatively

var relative = require('require-relative');

relative.resolve('./some-module', '/home/kamicane'); // /home/kamicane/some-module.js
relative.resolve('some-package', '/home/kamicane'); // /home/kamicane/node_modules/some-package/index.js
var isTrue = relative.resolve('./some-module.js', process.cwd()) === relative.resolve('./some-module.js');