Skip to content

Commit

Permalink
refactor: replace get-stdin with native alternative (#345)
Browse files Browse the repository at this point in the history
* refactor: replace `get-stdin` with native alternative

* chore: fix eslint config

* fix: remove `get-stdin`
  • Loading branch information
fisker authored Mar 4, 2025
1 parent c583a38 commit acd24cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
8 changes: 5 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env node
import { globSync } from 'tinyglobby'
import fs from 'node:fs'
import streamConsumers from 'node:stream/consumers'
import { parseArgs } from 'node:util'
import getStdin from 'get-stdin'
import { globSync } from 'tinyglobby'
import sortPackageJson from './index.js'
import Reporter from './reporter.js'

Expand Down Expand Up @@ -88,7 +88,9 @@ function sortPackageJsonFiles(patterns, { ignore, ...options }) {
}

async function sortPackageJsonFromStdin() {
process.stdout.write(sortPackageJson(await getStdin()))
process.stdout.write(
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.1",
"get-stdin": "^9.0.0",
"git-hooks-list": "^4.0.0",
"is-plain-obj": "^4.1.0",
"semver": "^7.7.1",
Expand Down

0 comments on commit acd24cf

Please sign in to comment.