Skip to content

Commit acd24cf

Browse files
authored
refactor: replace get-stdin with native alternative (#345)
* refactor: replace `get-stdin` with native alternative * chore: fix eslint config * fix: remove `get-stdin`
1 parent c583a38 commit acd24cf

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

cli.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
2-
import { globSync } from 'tinyglobby'
32
import fs from 'node:fs'
3+
import streamConsumers from 'node:stream/consumers'
44
import { parseArgs } from 'node:util'
5-
import getStdin from 'get-stdin'
5+
import { globSync } from 'tinyglobby'
66
import sortPackageJson from './index.js'
77
import Reporter from './reporter.js'
88

@@ -88,7 +88,9 @@ function sortPackageJsonFiles(patterns, { ignore, ...options }) {
8888
}
8989

9090
async function sortPackageJsonFromStdin() {
91-
process.stdout.write(sortPackageJson(await getStdin()))
91+
process.stdout.write(
92+
sortPackageJson(await streamConsumers.text(process.stdin)),
93+
)
9294
}
9395

9496
function run() {

package-lock.json

-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"dependencies": {
7777
"detect-indent": "^7.0.1",
7878
"detect-newline": "^4.0.1",
79-
"get-stdin": "^9.0.0",
8079
"git-hooks-list": "^4.0.0",
8180
"is-plain-obj": "^4.1.0",
8281
"semver": "^7.7.1",

0 commit comments

Comments
 (0)