
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
standard-json
Advanced tools
Format JavaScript Standard Style output to a JSON array!
# use the CLI
npm install --global standard-json
# or use programatically
npm install --save standard-json
standard | standard-json
# exit code will be 1 if any errors are found
standard --verbose | standard-json
# the ruleId attribute will be filled in if --verbose is passed
# works with anything based on standard-engine!
semistandard | standard-json
doublestandard | standard-json
Typical standard
output:
standard: Use JavaScript Standard Style (https://github.com/feross/standard)
/home/icmpdev/code/standard-json/bin.js:19:21: Missing space before function parentheses.
/home/icmpdev/code/standard-json/index.js:6:35: Strings must use singlequote.
/home/icmpdev/code/standard-json/index.js:6:51: Extra semicolon.
/home/icmpdev/code/standard-json/index.js:17:5: Keyword "if" must be followed by whitespace.
/home/icmpdev/code/standard-json/index.js:22:28: Extra semicolon.
After running through standard-json:
[
{
"filePath": "/home/flet/code/something-great/bin.js",
"messages": [
{
"line": "19",
"column": "21",
"message": "Missing space before function parentheses."
}
]
},
{
"filePath": "/home/flet/code/something-great/index.js",
"messages": [
{
"line": "6",
"column": "35",
"message": "Strings must use singlequote."
},
{
"line": "6",
"column": "51",
"message": "Extra semicolon."
},
{
"line": "17",
"column": "5",
"message": "Keyword \"if\" must be followed by whitespace."
},
{
"line": "22",
"column": "28",
"message": "Extra semicolon."
}
]
}
]
var txt = someStandardThing() // produces Standard Style output
var standardJson = require('standard-json')
var output = standardJson(txt)
// output will be an array of errors or an empty array.
var output = standardJson(txt, {noisey: true})
// output will be an array of errors or an empty array.
// The banner will be `console.error`'d (plus any other non-parsable lines)
This package was inspired by:
Contributions welcome! Please read the contributing guidelines first.
FAQs
Format JavaScript Standard Style output to a JSON array.
The npm package standard-json receives a total of 50,589 weekly downloads. As such, standard-json popularity was classified as popular.
We found that standard-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.