Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-pkg-up

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-pkg-up - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

26

index.js
'use strict';
const path = require('path');
const findUp = require('find-up');
const readPkg = require('read-pkg');
module.exports = options => {
return findUp('package.json', options).then(fp => {
if (!fp) {
return {};
}
module.exports = async options => {
const filePath = await findUp('package.json', options);
return readPkg(fp, options).then(pkg => ({pkg, path: fp}));
});
if (!filePath) {
return {};
}
return {
pkg: await readPkg({...options, cwd: path.dirname(filePath)}),
path: filePath
};
};
module.exports.sync = options => {
const fp = findUp.sync('package.json', options);
const filePath = findUp.sync('package.json', options);
if (!fp) {
if (!filePath) {
return {};

@@ -23,5 +27,5 @@ }

return {
pkg: readPkg.sync(fp, options),
path: fp
pkg: readPkg.sync({...options, cwd: path.dirname(filePath)}),
path: filePath
};
};
{
"name": "read-pkg-up",
"version": "4.0.0",
"version": "5.0.0",
"description": "Read the closest package.json file",

@@ -13,3 +13,3 @@ "license": "MIT",

"engines": {
"node": ">=6"
"node": ">=8"
},

@@ -52,8 +52,8 @@ "scripts": {

"find-up": "^3.0.0",
"read-pkg": "^3.0.0"
"read-pkg": "^5.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
"ava": "^1.3.1",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc