Comparing version 6.0.0 to 7.0.0
#!/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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
6
0
52
0
210776
1
102
- Removedstandard@*
- Removed@eslint-community/eslint-utils@4.4.1(transitive)
- Removed@eslint-community/regexpp@4.12.1(transitive)
- Removed@eslint/eslintrc@2.1.4(transitive)
- Removed@eslint/js@8.57.1(transitive)
- Removed@humanwhocodes/config-array@0.13.0(transitive)
- Removed@humanwhocodes/module-importer@1.0.1(transitive)
- Removed@humanwhocodes/object-schema@2.0.3(transitive)
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removed@rtsao/scc@1.1.0(transitive)
- Removed@types/json5@0.0.29(transitive)
- Removed@ungap/structured-clone@1.2.0(transitive)
- Removedacorn@8.14.0(transitive)
- Removedacorn-jsx@5.3.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarray-includes@3.1.8(transitive)
- Removedarray.prototype.findlast@1.2.5(transitive)
- Removedarray.prototype.findlastindex@1.2.5(transitive)
- Removedarray.prototype.flat@1.3.2(transitive)
- Removedarray.prototype.flatmap@1.3.2(transitive)
- Removedarray.prototype.tosorted@1.1.4(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuiltins@5.1.0(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcallsites@3.1.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcross-spawn@7.0.3(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddebug@3.2.74.3.7(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddoctrine@2.1.03.0.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedes-abstract@1.23.3(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-iterator-helpers@1.2.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-shim-unscopables@1.0.2(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedescape-string-regexp@4.0.0(transitive)
- Removedeslint@8.57.1(transitive)
- Removedeslint-config-standard@17.1.0(transitive)
- Removedeslint-config-standard-jsx@11.0.0(transitive)
- Removedeslint-import-resolver-node@0.3.9(transitive)
- Removedeslint-module-utils@2.12.0(transitive)
- Removedeslint-plugin-es@4.1.0(transitive)
- Removedeslint-plugin-import@2.31.0(transitive)
- Removedeslint-plugin-n@15.7.0(transitive)
- Removedeslint-plugin-promise@6.6.0(transitive)
- Removedeslint-plugin-react@7.37.2(transitive)
- Removedeslint-scope@7.2.2(transitive)
- Removedeslint-utils@2.1.03.0.0(transitive)
- Removedeslint-visitor-keys@1.3.02.1.03.4.3(transitive)
- Removedespree@9.6.1(transitive)
- Removedesquery@1.6.0(transitive)
- Removedesrecurse@4.3.0(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfast-levenshtein@2.0.6(transitive)
- Removedfastq@1.17.1(transitive)
- Removedfile-entry-cache@6.0.1(transitive)
- Removedfind-up@3.0.05.0.0(transitive)
- Removedflat-cache@3.2.0(transitive)
- Removedflatted@3.3.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedget-stdin@8.0.0(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@6.0.2(transitive)
- Removedglobals@13.24.0(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedgraphemer@1.4.0(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedignore@5.3.2(transitive)
- Removedimport-fresh@3.3.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-async-function@2.0.0(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-finalizationregistry@1.0.2(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-path-inside@3.0.3(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedis-weakset@2.0.3(transitive)
- Removedisarray@2.0.5(transitive)
- Removedisexe@2.0.0(transitive)
- Removediterator.prototype@1.1.3(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedjson-buffer@3.0.1(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stable-stringify-without-jsonify@1.0.1(transitive)
- Removedjson5@1.0.2(transitive)
- Removedjsx-ast-utils@3.3.5(transitive)
- Removedkeyv@4.5.4(transitive)
- Removedlevn@0.4.1(transitive)
- Removedload-json-file@5.3.0(transitive)
- Removedlocate-path@3.0.06.0.0(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednatural-compare@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedobject.entries@1.1.8(transitive)
- Removedobject.fromentries@2.0.8(transitive)
- Removedobject.groupby@1.0.3(transitive)
- Removedobject.values@1.2.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedoptionator@0.9.4(transitive)
- Removedp-limit@2.3.03.1.0(transitive)
- Removedp-locate@3.0.05.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedparent-module@1.0.1(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpath-exists@3.0.04.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpify@4.0.1(transitive)
- Removedpkg-conf@3.1.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedprelude-ls@1.2.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedreflect.getprototypeof@1.0.6(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedregexpp@3.2.0(transitive)
- Removedresolve@1.22.82.0.0-next.5(transitive)
- Removedresolve-from@4.0.0(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedsemver@6.3.17.6.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstandard@17.1.2(transitive)
- Removedstandard-engine@15.1.0(transitive)
- Removedstring.prototype.matchall@4.0.11(transitive)
- Removedstring.prototype.repeat@1.0.0(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedstrip-json-comments@3.1.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtsconfig-paths@3.15.0(transitive)
- Removedtype-check@0.4.0(transitive)
- Removedtype-fest@0.20.20.3.1(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedversion-guard@1.1.3(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-builtin-type@1.1.4(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedword-wrap@1.2.5(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxdg-basedir@4.0.0(transitive)
- Removedyocto-queue@0.1.0(transitive)