pkg-up
Advanced tools
Comparing version 1.0.0 to 2.0.0
11
index.js
'use strict'; | ||
var findUp = require('find-up'); | ||
const findUp = require('find-up'); | ||
module.exports = function (cwd) { | ||
return findUp('package.json', {cwd: cwd}); | ||
}; | ||
module.exports.sync = function (cwd) { | ||
return findUp.sync('package.json', {cwd: cwd}); | ||
}; | ||
module.exports = cwd => findUp('package.json', {cwd}); | ||
module.exports.sync = cwd => findUp.sync('package.json', {cwd}); |
{ | ||
"name": "pkg-up", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Find the closest package.json file", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
@@ -32,6 +32,4 @@ "scripts": { | ||
"look", | ||
"file", | ||
"search", | ||
"match", | ||
"package", | ||
"resolve", | ||
@@ -48,3 +46,3 @@ "parent", | ||
"dependencies": { | ||
"find-up": "^1.0.0" | ||
"find-up": "^2.1.0" | ||
}, | ||
@@ -51,0 +49,0 @@ "devDependencies": { |
@@ -28,5 +28,5 @@ # pkg-up [![Build Status](https://travis-ci.org/sindresorhus/pkg-up.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-up) | ||
// example.js | ||
var pkgUp = require('pkg-up'); | ||
const pkgUp = require('pkg-up'); | ||
pkgUp().then(function (filepath) { | ||
pkgUp().then(filepath => { | ||
console.log(filepath); | ||
@@ -42,12 +42,12 @@ //=> '/Users/sindresorhus/foo/package.json' | ||
Returns a promise that resolves to a filepath or `null`. | ||
Returns a `Promise` for either the filepath or `null` if it could be found. | ||
### pkgUp.sync([cwd]) | ||
Returns a filepath or `null`. | ||
Returns the filepath or `null`. | ||
#### cwd | ||
Type: `string` | ||
Default: `'.'` | ||
Type: `string` | ||
Default: `process.cwd()` | ||
@@ -60,3 +60,3 @@ Directory to start from. | ||
- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file | ||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of a npm package | ||
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package | ||
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories | ||
@@ -67,2 +67,2 @@ | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
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
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
3277
4
+ Addedfind-up@2.1.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
Updatedfind-up@^2.1.0