Socket
Socket
Sign inDemoInstall

@pnpm/read-package-json

Package Overview
Dependencies
Maintainers
3
Versions
73
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 3.0.2 to 3.1.0

2

lib/index.d.ts
import { PackageManifest } from '@pnpm/types';
export default function readPkg(pkgPath: string): Promise<PackageManifest>;
export declare function fromDir(pkgPath: string): Promise<PackageManifest>;
export declare function safeReadPackage(pkgPath: string): Promise<PackageManifest | null>;
export declare function safeReadPackageFromDir(pkgPath: string): Promise<PackageManifest | null>;

@@ -24,1 +24,17 @@ "use strict";

exports.fromDir = fromDir;
async function safeReadPackage(pkgPath) {
try {
return await readPkg(pkgPath);
}
catch (err) {
if (err.code !== 'ENOENT')
throw err;
return null;
}
}
exports.safeReadPackage = safeReadPackage;
function safeReadPackageFromDir(pkgPath) {
return safeReadPackage(path.join(pkgPath, 'package.json'));
}
exports.safeReadPackageFromDir = safeReadPackageFromDir;
//# sourceMappingURL=index.js.map

21

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

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

"engines": {
"node": ">=10"
"node": ">=10.13"
},
"files": [
"lib"
"lib",
"!*.map"
],
"scripts": {
"lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts",
"test": "pnpm run tsc && ts-node test --type-check",
"prepublishOnly": "pnpm run tsc",
"tsc": "tsc"
"_test": "cd ../.. && c8 --reporter lcov --reports-dir packages/read-package-json/coverage ts-node packages/read-package-json/test --type-check",
"test": "pnpm run compile && pnpm run _test",
"prepublishOnly": "pnpm run compile",
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build"
},

@@ -25,8 +27,3 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/read-package-json",

],
"author": {
"name": "Zoltan Kochan",
"email": "z@kochan.io",
"url": "https://www.kochan.io/",
"twitter": "ZoltanKochan"
},
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)",
"license": "MIT",

@@ -33,0 +30,0 @@ "bugs": {

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