
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
npm-package-json-lint
Advanced tools
A package.json linter for Node projects
npm-package-json-lint helps enforce standards for your package.json file. Currently it can check for:
name should always be a string.Please see the wiki for a list of rules.
First thing first, let's make sure you have the necessary pre-requisites.
npm install npm-package-json-lint -g| Command | Alias | Description |
|---|---|---|
| pjl-cli --help | -h | Lists supported CLI options |
| pjl-cli --version | -v | Lists the current version number |
| pjl-cli --file | -f | File path including name. Defaults to package.json |
| pjl-cli --rule | -r | Valid rule name to check. Defaults to nothing |
| pjl-cli --rules-file | -c | File path of .npmpackagejsonlintrc |
| pjl-cli --rule-severity | -s | "error" or "warning". Defaults to "error" |
| pjl-cli --quiet | -q | Report errors only |
| pjl-cli --ignore-warnings | -w | Ignore warnings |
Run a specific rule, require-author, on a file relative to the current working directory.
pjl-cli -f "../relative-path/package.json" -r "require-author"
Run a specific rule, require-author, ignoring warnings on a file relative to the current working directory.
pjl-cli -f "../relative-path/package.json" -r "require-author" --ignore-warnings
Run a specific rule, require-author, set severity to warning on a file relative to the current working directory.
pjl-cli -f "../relative-path/package.json" -r "require-author" -s "warning"
Run using the config in .npmpackagejsonlintrc on a file relative to the current working directory.
pjl-cli -f "../relative-path/package.json" -c "./.npmpackagejsonlintrc"
Run on file relative to the current working directory. npm-package-json-lint attempts to find config. See lookup order below.
pjl-cli -f "../relative-path/package.json"
Run on file in the current working directory. npm-package-json-lint attempts to find config. See lookup order below.
pjl-cli
npm-package-json-lint has a configurable set of rules. Please see the wiki for a full list of available rules. By default no rules are enabled. If you would like to use npm-package-json-lint's default ruleset, please see npm-package-json-lint-config-default.
Each rule contains the following properties:
As mentioned in the "Commands and configuration" section there are two ways to specify rule sets. The first is using --rule to specify a given rule. This will run npm-package-json-lint with just this rule. The second is providing a configuration object. As of v2.7.0, there are multiple ways to provide a configuration object.
--rules-file to the command to specify a JSON file. This file is typically named .npmpackagejsonlintrc; however, you may optionally add a .json extension if you prefer.npmPackageJsonLintConfig property in package.json filenpmpackagejsonlint.config.js file that exports a config object in the current working directory..npmpackagejsonlintrc.json file in the root of your user directorynpmpackagejsonlint.config.js file that exports a config object in the root of your user directorynpm-package-json-lint rules can either be run as an error, warning, or off.
Ex: "require-author": "error"
Please see the migration guide.
Please see the migration guide.
Please see CONTRIBUTING.md.
Please see CHANGELOG.md.
Copyright (c) 2016-2017 Thomas Lindner. Licensed under the MIT license.
eslint-plugin-json is an ESLint plugin that allows you to lint JSON files, including package.json. It provides a way to enforce JSON-specific rules using the familiar ESLint framework. Compared to npm-package-json-lint, it integrates JSON linting into the broader ESLint ecosystem.
jsonlint is a pure JavaScript library for validating and formatting JSON data. While it doesn't provide package.json-specific rules, it ensures that JSON files are syntactically correct. It is more general-purpose compared to npm-package-json-lint.
json-schema is a library for validating JSON documents against a JSON Schema. It can be used to enforce a schema for package.json files, ensuring they adhere to a predefined structure. Unlike npm-package-json-lint, it focuses on schema validation rather than linting rules.
FAQs
Configurable linter for package.json files.
The npm package npm-package-json-lint receives a total of 123,703 weekly downloads. As such, npm-package-json-lint popularity was classified as popular.
We found that npm-package-json-lint 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.