Comparing version 0.4.0 to 0.5.0
10
index.js
@@ -53,2 +53,11 @@ 'use strict'; | ||
function loadOne(path, name) { | ||
if (name in module.exports) { | ||
throw new Error(fmt('libKey \'%s\' already exists', name)); | ||
} | ||
module.exports[name] = require(path); | ||
} | ||
function load(opts){ | ||
@@ -74,3 +83,4 @@ opts = _.defaults(opts || {},{ | ||
load: load, | ||
loadOne: loadOne, | ||
loadMany: loadMany | ||
}; |
{ | ||
"name": "lib-loader", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "load and cache libraries and configs using the require system for easy access", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
6285
85
3