Skip to content

Commit

Permalink
refactor: replace get-stdin with native alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Mar 1, 2025
1 parent ec74b4c commit a7377d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
10 changes: 7 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node
import { globSync } from 'tinyglobby'
import fs from 'node:fs'
import getStdin from 'get-stdin'
// eslint-disable-next-line n/no-unsupported-features/node-builtins
import streamConsumers from 'node:stream/consumers'
import { globSync } from 'tinyglobby'
import sortPackageJson from './index.js'
import Reporter from './reporter.js'

Expand Down Expand Up @@ -60,7 +61,10 @@ function sortPackageJsonFiles(patterns, { ignore, ...options }) {
}

async function sortPackageJsonFromStdin() {
process.stdout.write(sortPackageJson(await getStdin()))
process.stdout.write(
// eslint-disable-next-line n/no-unsupported-features/node-builtins
sortPackageJson(await streamConsumers.text(process.stdin)),
)
}

function run() {
Expand Down
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"dependencies": {
"detect-indent": "^7.0.1",
"detect-newline": "^4.0.0",
"get-stdin": "^9.0.0",
"git-hooks-list": "^3.0.0",
"is-plain-obj": "^4.1.0",
"semver": "^7.6.0",
Expand Down

0 comments on commit a7377d2

Please sign in to comment.