Skip to content

Require common-js modules and js files that return values

Notifications You must be signed in to change notification settings

iamstarkov/require-or-die

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Require common-js modules and js files that return values

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%