Socket
Socket
Sign inDemoInstall

@pnpm/read-package-json

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/read-package-json - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

32

lib/index.js
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -15,15 +7,13 @@ const path = require("path");

const readPackageJson = promisify(readPackageJsonCB);
function readPkg(pkgPath) {
return __awaiter(this, void 0, void 0, function* () {
try {
return yield readPackageJson(pkgPath);
}
catch (err) {
if (err['code'])
throw err; // tslint:disable-line
const pnpmError = new Error(`${pkgPath}: ${err.message}`);
pnpmError['code'] = 'ERR_PNPM_BAD_PACKAGE_JSON'; // tslint:disable-line
throw pnpmError;
}
});
async function readPkg(pkgPath) {
try {
return await readPackageJson(pkgPath);
}
catch (err) {
if (err['code'])
throw err; // tslint:disable-line
const pnpmError = new Error(`${pkgPath}: ${err.message}`);
pnpmError['code'] = 'ERR_PNPM_BAD_PACKAGE_JSON'; // tslint:disable-line
throw pnpmError;
}
}

@@ -30,0 +20,0 @@ exports.default = readPkg;

{
"name": "@pnpm/read-package-json",
"version": "1.1.1",
"version": "2.0.0",
"description": "Read a package.json",

@@ -8,3 +8,3 @@ "main": "lib/index.js",

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

@@ -40,3 +40,3 @@ "files": [

"dependencies": {
"@pnpm/types": "^2.0.0",
"@pnpm/types": "^3.0.0",
"read-package-json": "2.0.13",

@@ -52,3 +52,3 @@ "util.promisify": "^1.0.0"

"tape": "^4.8.0",
"ts-node": "^7.0.0",
"ts-node": "^8.0.1",
"tslint": "^5.8.0",

@@ -55,0 +55,0 @@ "typescript": "^3.0.0"

Sorry, the diff of this file is not supported yet

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