async-require
async-require
asyncronous module loader
Example
//ironically loading async-require using syncronaous require.var asyncRequire = ;
Promise.<(module|Error)>
⏏
requireAsync(module) ⇒ Kind: Exported function
Param | Type | Description |
---|---|---|
module | string |
the path to the module without a .js extension |
Example
//load script myModule.js;
requireAsync~load - A promisified function that accepts a moduleId as an argument and returns a promise resolving in an object with a toString method such as a Buffer or a String.()
load is used by async-require to load the script. By default it load a file relative to the calling module similar to how require works when loading module not installed through npm. Since this function is public you can set a new load method.
Kind: inner method of requireAsync
Access: public
Example
load a script with request
var asyncRequire = request = Promise = //load must return a promise get = Promise; //overwrite the default load asyncRequire{ //get the script return }