How to use the module._load function in module

To help you get started, we’ve selected a few module examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber-archive / nanny / _worker.js View on Github external
function handleStart(modulePath, givenPulse) {

    if (started) {
        throw new Error('Assertion failed: worker received a second start message over its IPC channel');
    }
    started = true;

    // Start periodic health reports.
    pulse = givenPulse;
    if (pulse) {
        tick();
    }

    // Start running the worker module.
    Module._load(modulePath, null, true);
}
github ruowo / stdx / scripts / pnode / main.js View on Github external
var Module = require('module')
let entrypoint = process.argv[2]
if (entrypoint) {
  if (entrypoint === '-m') {
    console.log(process.versions.modules)
    process.exit(0)
  } else if (entrypoint === '-v') {
    console.log(process.versions.node)
    process.exit(0)
  }
  Module._load(entrypoint, null, true)
  process._tickCallback() 
}
github kaoscript / kaoscript / lib / bin.js View on Github external
var _require = sandbox.require = function(path) {
			if(arguments.length < 1) {
				throw new SyntaxError("Wrong number of arguments (" + arguments.length + " for 1)");
			}
			if(path === void 0 || path === null) {
				throw new TypeError("'path' is not nullable");
			}
			return Module._load(path, _module, true);
		};
		_module.filename = file;
github arqex / amdrequire / amdrequire.js View on Github external
noderequire = function(dep, thisModule){
		//Call _load directly as we can't set this object for require.
		return Module._load(dep, thisModule);
	},

module

Generate the minimal skeleton/boilerplate for a new Node.js module.

MIT
Latest version published 8 years ago

Package Health Score

41 / 100
Full package analysis