@pnpm/read-package-json
Advanced tools
Comparing version 3.0.2 to 3.1.0
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 |
{ | ||
"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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4635
43