Comparing version 0.1.0 to 0.2.0
11
lib.js
@@ -7,4 +7,13 @@ /** | ||
exports._ = exports.path = function(name){ | ||
_getPath = exports.path = function(name){ | ||
return path.join(__dirname, '../../', name) | ||
}; | ||
exports._ = function(name){ | ||
console.warn("p2r._ will be deleted, please use p2r.path."); | ||
return _getPath(name); | ||
}; | ||
exports.require = function(name){ | ||
return require(_getPath(name)) | ||
}; |
{ | ||
"name": "p2r", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "get path relative to project dir", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
@@ -5,2 +5,4 @@ ##path-2-root | ||
[](https://nodei.co/npm/p2r/) | ||
###Install | ||
@@ -21,2 +23,7 @@ | ||
var p2r = require('p2r'); | ||
var lib = require(p2r._('config.js')); | ||
var lib = require(p2r.path('config.js')); | ||
Or: | ||
var p2r = require('p2r'); | ||
var lib = p2r.require('config.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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2469
13
28
0
1