Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace get-stdin with built-in stream consumer #1375

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading