Socket
Socket
Sign inDemoInstall

pkg-up

Package Overview
Dependencies
6
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc