Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@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)
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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.