normalize-require
Advanced tools
Comparing version 1.0.1 to 1.1.0
40
index.js
@@ -1,40 +0,2 @@ | ||
/** | ||
* Require the module at `name`. | ||
* | ||
* @param {String} name | ||
* @return {Object} exports | ||
* @api public | ||
*/ | ||
function require(name) { | ||
var module = require.modules[name]; | ||
if (!module) throw new Error('failed to require "' + name + '"'); | ||
var definition = module.definition; | ||
if (definition) { | ||
definition.call(this, module.exports = {}, module); | ||
delete module.definition; | ||
} | ||
return module.exports; | ||
} | ||
/** | ||
* Registered modules. | ||
*/ | ||
require.modules = {}; | ||
/** | ||
* Register module at `name` with callback `definition`. | ||
* | ||
* @param {String} name | ||
* @param {Function} definition | ||
* @api private | ||
*/ | ||
require.register = function (name, definition) { | ||
require.modules[name] = { | ||
definition: definition | ||
}; | ||
}; | ||
module.exports = require('fs').readFileSync(require.resolve('./require.js'), 'utf8') |
{ | ||
"name": "normalize-require", | ||
"description": "nlz's require implementation", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3046
6
34
2