Skip to content

Commit

Permalink
change: replace get-stdin with built-in stream consumer (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torathion authored Mar 8, 2024
1 parent ab0aff0 commit aed0c5f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .ncurc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ module.exports = {
// ESM only modules
// https://github.com/microsoft/TypeScript/issues/46452
'find-up',
'get-stdin',
'globby',
/* pin to 4.0.0 to match make-fetch-happen/cacache. */
'p-map',
'remote-git-tags',
Expand Down
13 changes: 0 additions & 13 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 @@ -67,7 +67,6 @@
"fast-memoize": "^2.5.2",
"find-up": "5.0.0",
"fp-and-or": "^1.0.2",
"get-stdin": "^8.0.0",
"hosted-git-info": "^5.1.0",
"ini": "^4.1.1",
"js-yaml": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/findPackage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import findUp from 'find-up'
import fs from 'fs/promises'
import getstdin from 'get-stdin'
import { text } from 'node:stream/consumers'
import path from 'path'
import { print } from '../lib/logging'
import { Options } from '../types/Options'
Expand Down Expand Up @@ -65,7 +65,7 @@ async function findPackage(options: Options): Promise<{

// get data from stdin
// trim stdin to account for \r\n
const stdinData = await getstdin()
const stdinData = await text(process.stdin)
const data = stdinData.trim().length > 0 ? stdinData : null

// if no stdin content fall back to searching for package.json from pwd and up to root
Expand Down

0 comments on commit aed0c5f

Please sign in to comment.