Skip to content

Commit af84292

Browse files
committed
chore: replace get-stdin with native stream/consumers
This follows the recommendation from Sindre Sorhus (author of get-stdin / src: https://github.com/sindresorhus/get-stdin/tree/main?tab=readme-ov-file#tip) to use the built-in streamConsumers.text() in modern Node.js versions. Reduces external dependencies while maintaining identical functionality.
1 parent 1882ff2 commit af84292

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

Diff for: bin/sql-formatter-cli.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const tty = require('tty');
99
const { version } = require('../package.json');
1010
const { ArgumentParser } = require('argparse');
1111
const { promisify } = require('util');
12-
const getStdin = require('get-stdin');
12+
const { text } = require('node:stream/consumers');
1313

1414
class SqlFormatterCli {
1515
constructor() {
@@ -117,7 +117,7 @@ class SqlFormatterCli {
117117
if (this.args.file) {
118118
return await this.readFile(infile);
119119
} else {
120-
return await getStdin();
120+
return await text(process.stdin);
121121
}
122122
}
123123

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
},
7979
"dependencies": {
8080
"argparse": "^2.0.1",
81-
"get-stdin": "=8.0.0",
8281
"nearley": "^2.20.1"
8382
},
8483
"devDependencies": {

Diff for: yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -3541,11 +3541,6 @@ get-package-type@^0.1.0:
35413541
resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz"
35423542
integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==
35433543

3544-
get-stdin@=8.0.0:
3545-
version "8.0.0"
3546-
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz"
3547-
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
3548-
35493544
get-stream@^6.0.0, get-stream@^6.0.1:
35503545
version "6.0.1"
35513546
resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz"

0 commit comments

Comments
 (0)