@pnpm/read-project-manifest
Advanced tools
Comparing version 1.0.13 to 1.1.0
# @pnpm/read-project-manifest | ||
## 1.1.0 | ||
### Minor Changes | ||
- 2762781cc: safeReadProjectManifestOnly() added. | ||
## 1.0.13 | ||
@@ -4,0 +10,0 @@ |
import { ProjectManifest } from '@pnpm/types'; | ||
declare type WriteProjectManifest = (manifest: ProjectManifest, force?: boolean) => Promise<void>; | ||
export declare function safeReadProjectManifestOnly(projectDir: string): Promise<ProjectManifest | null>; | ||
export default function readProjectManifest(projectDir: string): Promise<{ | ||
@@ -4,0 +5,0 @@ fileName: string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readExactProjectManifest = exports.tryReadProjectManifest = exports.readProjectManifestOnly = void 0; | ||
exports.readExactProjectManifest = exports.tryReadProjectManifest = exports.readProjectManifestOnly = exports.safeReadProjectManifestOnly = void 0; | ||
const util_1 = require("util"); | ||
@@ -20,2 +20,14 @@ const error_1 = __importDefault(require("@pnpm/error")); | ||
const stat = util_1.promisify(fs.stat); | ||
async function safeReadProjectManifestOnly(projectDir) { | ||
try { | ||
return await readProjectManifestOnly(projectDir); | ||
} | ||
catch (err) { | ||
if (err.code === 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND') { | ||
return null; | ||
} | ||
throw err; | ||
} | ||
} | ||
exports.safeReadProjectManifestOnly = safeReadProjectManifestOnly; | ||
async function readProjectManifest(projectDir) { | ||
@@ -22,0 +34,0 @@ const result = await tryReadProjectManifest(projectDir); |
{ | ||
"name": "@pnpm/read-project-manifest", | ||
"version": "1.0.13", | ||
"version": "1.1.0", | ||
"description": "Read a project manifest (called package.json in most cases)", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=10.13" | ||
"node": ">=10.14" | ||
}, | ||
@@ -52,5 +52,5 @@ "files": [ | ||
"@types/parse-json": "^4.0.0", | ||
"tempy": "^0.6.0" | ||
"tempy": "^0.7.0" | ||
}, | ||
"funding": "https://opencollective.com/pnpm" | ||
} |
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
14010
268