sort-package-json
Advanced tools
Comparing version 2.4.1 to 2.5.0
10
cli.js
#!/usr/bin/env node | ||
import { globbySync } from 'globby' | ||
import fs from 'node:fs' | ||
import getStdin from 'get-stdin' | ||
import sortPackageJson from './index.js' | ||
@@ -26,2 +27,3 @@ import Reporter from './reporter.js' | ||
-v, --version Display the package version | ||
--stdin Read package.json from stdin | ||
`, | ||
@@ -61,2 +63,6 @@ ) | ||
async function sortPackageJsonFromStdin() { | ||
process.stdout.write(sortPackageJson(await getStdin())) | ||
} | ||
function run() { | ||
@@ -79,2 +85,6 @@ const cliArguments = process.argv.slice(2) | ||
if (cliArguments.some((argument) => argument === '--stdin')) { | ||
return sortPackageJsonFromStdin() | ||
} | ||
const patterns = [] | ||
@@ -81,0 +91,0 @@ let isCheck = false |
{ | ||
"name": "sort-package-json", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "Sort an Object or package.json based on the well-known package.json keys", | ||
@@ -72,2 +72,3 @@ "keywords": [ | ||
"detect-newline": "^4.0.0", | ||
"get-stdin": "^9.0.0", | ||
"git-hooks-list": "^3.0.0", | ||
@@ -74,0 +75,0 @@ "globby": "^13.1.2", |
@@ -92,2 +92,10 @@ # Sort Package.json | ||
### `--stdin` flag | ||
To read from `stdin` and output the result to `stdout` use the `--stdin` flag. | ||
```bash | ||
$ cat package.json | sort-package-json --stdin | ||
``` | ||
## API | ||
@@ -94,0 +102,0 @@ |
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
28178
572
272
7
+ Addedget-stdin@^9.0.0
+ Addedget-stdin@9.0.0(transitive)