require-or-die
v1.0.0
Published
Require Common.js modules as just js files, that returns value
Downloads
22
Readme
require-or-die
Requires common.js modules as well as simple js files, that returns values.
Usage
var rod = require('require-or-die');
rod('./sample.js', function (err, value) {
console.log(value);
})
API
require(path, [options], callback)
path
Type: String
Path to required file (will be resolved by require.resolve
).
options
Type: Object
Options, that will be passed to fs.readFile.
callback
Type: Function
Function, that will be called, when contents is read and processed. Signature pretty common: function (err, value)
.
require.sync(path)
Same as require
, but in sync way.
License
MIT (c) 2014 Vsevolod Strukchinsky