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.
prettier-plugin-packagejson
Advanced tools
Prettier package.json plugin to make the order of properties nice.
The prettier-plugin-packagejson npm package is a plugin for Prettier that formats your package.json file according to a consistent style. It helps maintain a clean and organized package.json file by sorting and formatting its contents.
Sorting dependencies
This feature sorts the dependencies in your package.json file alphabetically, ensuring a consistent order.
{
"dependencies": {
"express": "^4.17.1",
"lodash": "^4.17.21"
}
}
Sorting scripts
This feature sorts the scripts in your package.json file alphabetically, making it easier to find and manage scripts.
{
"scripts": {
"build": "webpack",
"start": "node index.js"
}
}
Sorting other fields
This feature sorts other fields like keywords, contributors, etc., alphabetically to maintain a clean and organized structure.
{
"keywords": [
"formatting",
"prettier",
"plugin"
]
}
The sort-package-json package sorts the keys in your package.json file. It provides similar functionality to prettier-plugin-packagejson by organizing the structure of the package.json file, but it is a standalone tool rather than a Prettier plugin.
The fixpack package is another tool that formats and sorts the fields in your package.json file. It focuses on keeping the package.json file clean and consistent, similar to prettier-plugin-packagejson, but it also includes additional checks for common errors and best practices.
A Prettier plugin to sort the keys of a package.json
file using sort-package-json.
npm i -D prettier prettier-plugin-packagejson
For prettier v3+ you need to configure
module.exports = {
// add this
plugins: ['prettier-plugin-packagejson'],
}
FAQs
Prettier package.json plugin to make the order of properties nice.
The npm package prettier-plugin-packagejson receives a total of 741,056 weekly downloads. As such, prettier-plugin-packagejson popularity was classified as popular.
We found that prettier-plugin-packagejson demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.