Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
@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.
Read a project manifest (called package.json in most cases)
<npm|yarn|pnpm> add @pnpm/read-project-manifest
import readProjectManifest from '@pnpm/read-project-manifest'
const { manifest, fileName } = await readProjectManifest(process.cwd())
MIT
FAQs
Read a project manifest (called package.json in most cases)
The npm package @pnpm/read-project-manifest receives a total of 313,975 weekly downloads. As such, @pnpm/read-project-manifest popularity was classified as 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.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.