Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@pnpm/read-project-manifest
Advanced tools
Read a project manifest (called package.json in most cases)
@pnpm/read-project-manifest is a utility package that allows you to read and parse the manifest files (like package.json) of a project. This can be useful for various tasks such as dependency management, project configuration analysis, and more.
Read package.json
This feature allows you to read the package.json file of the current project directory. The function returns the parsed manifest object and the file name.
const { readProjectManifest } = require('@pnpm/read-project-manifest');
async function readManifest() {
const { manifest, fileName } = await readProjectManifest(process.cwd());
console.log(manifest);
console.log(`Manifest file read from: ${fileName}`);
}
readManifest();
Read specific manifest file
This feature allows you to read a specific manifest file by providing its path. The function returns the parsed manifest object.
const { readProjectManifestOnly } = require('@pnpm/read-project-manifest');
async function readSpecificManifest(filePath) {
const manifest = await readProjectManifestOnly(filePath);
console.log(manifest);
}
readSpecificManifest('./path/to/package.json');
The read-pkg package is a utility for reading and parsing package.json files. It offers similar functionality to @pnpm/read-project-manifest but is more focused on simplicity and ease of use. It does not provide as many options for reading different types of manifest files.
The pkg-up package finds the closest package.json file by traversing up from the specified directory. While it does not directly read the manifest file, it helps locate the file, which can then be read using other utilities like read-pkg.
The find-up package is a general utility for finding a file or directory by walking up parent directories. It can be used to locate a package.json file, which can then be read using other packages. It is more versatile but less specialized than @pnpm/read-project-manifest.
FAQs
Read a project manifest (called package.json in most cases)
The npm package @pnpm/read-project-manifest receives a total of 0 weekly downloads. As such, @pnpm/read-project-manifest popularity was classified as not popular.
We found that @pnpm/read-project-manifest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.