parent-package-json
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,3 +5,3 @@ var fs = require('fs'), | ||
module.exports = function findPackageJSON(startPath) { | ||
startPath = startPath || __dirname; | ||
startPath = startPath || process.cwd(); | ||
var searchPath = path.join(startPath + '/..'); | ||
@@ -8,0 +8,0 @@ |
{ | ||
"name": "parent-package-json", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Find, read and parse the package.json of the parent module", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -35,3 +35,3 @@ # parent-package-json | ||
Usually, `parent-package-json` will use `__dirname` for starting at, it will search the parent folders up until `/` for finding a `package.json` (and stops as soon as it finds one). If you want it to start somewhere other than `__dirname`, provide a path as an argument instead: | ||
Usually, `parent-package-json` will use `process.cwd()` for starting at, it will search the parent folders up until `/` for finding a `package.json` (and stops as soon as it finds one). If you want it to start somewhere other than `process.cwd()`, provide a path as an argument instead: | ||
@@ -38,0 +38,0 @@ ```javascript |
@@ -38,7 +38,2 @@ var assert = require('assert'), | ||
}); | ||
it('should find its own package.json', function() { | ||
mock.restore(); | ||
expect(parent()).to.not.equal(false); | ||
mock(mockFs); | ||
}); | ||
}); | ||
@@ -45,0 +40,0 @@ |
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
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
7453
81