Util.require()

Load (`require()`) a Node.js module located at the specified path and return whatever it exports.

By default, the **require cache will not be cleared**. To learn more about what that means, check out [the section on the require cache in the official Node.js docs](https://nodejs.org/api/modules.html#modules_caching). Also note that this method uses the default behavior of `requiree()` in Node.js, so beware of circular/cyclical dependencies! See [Modules/Cycles in the Node.js docs](https://nodejs.org/api/modules.html#modules_cycles) for more information.

Usage

Hover over inputs/exits for more info.

var Util = require('machinepack-util');


// Load (`require()`) a Node.js module located at the specified path and return whatever it exports.

Util.require({

path: '/code/machinepack-twitter',

}).execSync();

Inputs

path required

The absolute path to a Node.js module, or the absolute path to the directory of an NPM package.

'/code/machinepack-twitter'

Exits

error

An unexpected error occurred.

moduleNotFound

No module exists at the specified path.

couldNotLoad

A file exists at the specified path, but it could not be loaded as a Node.js module.

'==='
success

OK.

'==='