require-or-die

1.0.0 • Public • Published

require-or-die

NPM version Build Status Dependency Status

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

Readme

Keywords

Package Sidebar

Install

npm i require-or-die

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • floatdrop