Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snazzy

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snazzy - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

41

bin/cmd.js
#!/usr/bin/env node
var CompactToStylishStream = require('../')
var cp = require('child_process')
var minimist = require('minimist')
var path = require('path')
var STANDARD_CMD = path.join(require.resolve('standard'), '../../.bin/standard')
if (process.platform === 'win32') STANDARD_CMD += '.cmd'
var argv = minimist(process.argv.slice(2), {

@@ -17,31 +12,19 @@ boolean: [

var snazzy = new CompactToStylishStream()
// Set the process exit code based on whether snazzy found errors.
process.on('exit', function (code) {
if (code === 0 && snazzy.exitCode !== 0) {
process.exit(snazzy.exitCode)
}
})
process.stdout.on('error', function () {})
if (!process.stdin.isTTY || argv._[0] === '-' || argv.stdin) {
process.stdin.pipe(snazzy).pipe(process.stdout)
} else {
var args = process.argv.slice(2)
var standard = cp.spawn(STANDARD_CMD, args)
standard.stderr.pipe(process.stderr)
standard.stdout.pipe(snazzy).pipe(process.stdout)
var snazzy = new CompactToStylishStream()
// This only runs if snazzy finds no errors AND `standard` exited with a
// non-zero code. That means something weird happened, so set exit code to
// non-zero.
var standardCode
standard.on('exit', function (code) { standardCode = code })
// Set the process exit code based on whether snazzy found errors
process.on('exit', function (code) {
if (code === 0 && standardCode !== 0) {
console.error('Unexpected exit from the `standard` command')
process.exit(standardCode)
if (code === 0 && snazzy.exitCode !== 0) {
process.exitCode = snazzy.exitCode
}
})
process.stdin.pipe(snazzy).pipe(process.stdout)
} else {
console.error(`
snazzy: 'standard' is no longer bundled with 'snazzy'. Install standard
snazzy: ('npm install standard') then run 'standard | snazzy' instead.
`)
process.exitCode = 1
}

@@ -17,2 +17,3 @@ module.exports = CompactToStylishStream

this.exitCode = 0
this._buffer = []

@@ -19,0 +20,0 @@ }

{
"name": "snazzy",
"description": "Format JavaScript Standard Style as Stylish (i.e. snazzy) output",
"version": "6.0.0",
"version": "7.0.0",
"author": {

@@ -21,18 +21,20 @@ "name": "Feross Aboukhadijeh",

"readable-stream": "^2.0.6",
"standard": "*",
"standard-json": "^1.0.0",
"text-table": "^0.2.0"
},
"devDependencies": {
"standard": "*"
},
"homepage": "https://github.com/feross/snazzy",
"keywords": [
"stylish standard",
"pretty",
"pretty output",
"snazzy standard",
"standard",
"standard pretty",
"stylish",
"stylish for standard",
"stylish formatter",
"snazzy standard",
"stylish",
"stylish reporter",
"standard",
"pretty output",
"pretty",
"standard pretty"
"stylish standard"
],

@@ -46,4 +48,4 @@ "license": "MIT",

"scripts": {
"test": "./bin/cmd.js --verbose"
"test": "standard --verbose | ./bin/cmd.js"
}
}

@@ -1,9 +0,11 @@

# snazzy [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]
# snazzy [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[travis-image]: https://img.shields.io/travis/feross/snazzy.svg?style=flat
[travis-image]: https://img.shields.io/travis/feross/snazzy/master.svg
[travis-url]: https://travis-ci.org/feross/snazzy
[npm-image]: https://img.shields.io/npm/v/snazzy.svg?style=flat
[npm-image]: https://img.shields.io/npm/v/snazzy.svg
[npm-url]: https://npmjs.org/package/snazzy
[downloads-image]: https://img.shields.io/npm/dm/snazzy.svg?style=flat
[downloads-image]: https://img.shields.io/npm/dm/snazzy.svg
[downloads-url]: https://npmjs.org/package/snazzy
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

@@ -34,13 +36,14 @@ ### Format [JavaScript Standard Style](https://github.com/feross/standard) as Stylish (i.e. snazzy) output

Or, just run `snazzy` directly and it will run `standard` and give you pretty results:
## note about version 7.0.0
```bash
$ snazzy
```
`standard` is no longer bundled with snazzy. You must install `standard` manually
alongside `snazzy`.
`snazzy` supports all command line flags that `standard` supports:
Run `npm install standard --save-dev` to get a copy of `standard`, then run
`standard | snazzy` where you previously used to ran `snazzy`.
```bash
$ snazzy --format --verbose test1.js test2.js
```
This method requires more steps but it's better since the user controls the exact
version of `standard` that is used. And for users who were piping into `snazzy` all
along, this means a quicker install since an extra copy of `standard` will not get
installed.

@@ -47,0 +50,0 @@ ## license

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc