Skip to content

Commit 8933bf0

Browse files
committed
Require Node.js 12.20
1 parent 0e4c46e commit 8933bf0

File tree

5 files changed

+28
-29
lines changed

5 files changed

+28
-29
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 14
14-
- 12
15-
- 10
13+
- 16
1614
steps:
1715
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v1
16+
- uses: actions/setup-node@v2
1917
with:
2018
node-version: ${{ matrix.node-version }}
2119
- run: npm install

cli.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
#!/usr/bin/env node
2-
'use strict';
3-
const {promisify} = require('util');
4-
const stream = require('stream');
5-
const meow = require('meow');
6-
const {readableNoopStream, writableNoopStream} = require('noop-stream');
2+
import {promisify} from 'node:util';
3+
import stream from 'node:stream';
4+
import process from 'node:process';
5+
import meow from 'meow';
6+
import {readableNoopStream, writableNoopStream} from 'noop-stream';
77

88
const streamPipeline = promisify(stream.pipeline);
99

1010
meow(`
1111
Examples
1212
$ dev-null | cat
1313
$ echo '🦄' | dev-null
14-
`);
14+
`, {
15+
importMeta: import.meta,
16+
});
1517

1618
(async () => {
17-
if (process.stdin.isTTY) {
18-
await streamPipeline(readableNoopStream(), process.stdout);
19-
} else {
20-
await streamPipeline(process.stdin, writableNoopStream());
21-
}
19+
const promise = process.stdin.isTTY
20+
? streamPipeline(readableNoopStream(), process.stdout)
21+
: streamPipeline(process.stdin, writableNoopStream());
22+
23+
await promise;
2224
})();

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
"description": "Cross-platform `/dev/null`",
55
"license": "MIT",
66
"repository": "sindresorhus/dev-null-cli",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11+
"url": "https://sindresorhus.com"
1112
},
13+
"type": "module",
1214
"bin": {
13-
"dev-null": "cli.js"
15+
"dev-null": "./cli.js"
1416
},
1517
"engines": {
16-
"node": ">=10"
18+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
1719
},
1820
"scripts": {
1921
"test": "xo && ava"
@@ -34,12 +36,12 @@
3436
"noop"
3537
],
3638
"dependencies": {
37-
"meow": "^5.0.0",
38-
"noop-stream": "^0.1.0"
39+
"meow": "^10.1.1",
40+
"noop-stream": "^1.0.0"
3941
},
4042
"devDependencies": {
41-
"ava": "^1.4.1",
42-
"execa": "^1.0.0",
43-
"xo": "^0.24.0"
43+
"ava": "^3.15.0",
44+
"execa": "^5.1.1",
45+
"xo": "^0.45.0"
4446
}
4547
}

readme.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
> Cross-platform [`/dev/null`](https://en.wikipedia.org/wiki/Null_device)
44
5-
65
## Install
76

8-
```
9-
$ npm install --global dev-null-cli
7+
```sh
8+
npm install --global dev-null-cli
109
```
1110

12-
1311
## Usage
1412

1513
```
@@ -20,7 +18,6 @@ $ dev-null --help
2018
$ echo '🦄' | dev-null
2119
```
2220

23-
2421
## Related
2522

2623
- [noop-stream](https://github.com/sindresorhus/noop-stream) - Readable Node.js stream that produces no data or a writable stream that discards data

0 commit comments

Comments
 (0)