Skip to content

Commit

Permalink
Require Node.js 18
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 19, 2024
1 parent dd03f79 commit 42ad38e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 44 deletions.
4 changes: 0 additions & 4 deletions .github/funding.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 20
- 18
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
10 changes: 5 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
Stream,
Writable as WritableStream,
Readable as ReadableStream,
Duplex as DuplexStream,
Transform as TransformStream,
type Stream,
type Writable as WritableStream,
type Readable as ReadableStream,
type Duplex as DuplexStream,
type Transform as TransformStream,
} from 'node:stream';

export type Options = {
Expand Down
10 changes: 5 additions & 5 deletions index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
Stream,
Writable as WritableStream,
Readable as ReadableStream,
type Stream,
type Writable as WritableStream,
type Readable as ReadableStream,
Duplex as DuplexStream,
Transform as TransformStream,
type Transform as TransformStream,
} from 'node:stream';
import {expectType, expectAssignable} from 'tsd';
import {
Expand All @@ -12,7 +12,7 @@ import {
isReadableStream,
isDuplexStream,
isTransformStream,
Options,
type Options,
} from './index.js';

const foo = '';
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -35,10 +39,10 @@
"is"
],
"devDependencies": {
"@types/node": "^16.4.13",
"ava": "^3.15.0",
"tempy": "^1.0.1",
"tsd": "^0.17.0",
"xo": "^0.44.0"
"@types/node": "^20.11.19",
"ava": "^5.3.1",
"tempy": "^3.1.0",
"tsd": "^0.30.5",
"xo": "^0.57.0"
}
}
16 changes: 2 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
## Install

```
$ npm install is-stream
```sh
npm install is-stream
```

## Usage
Expand Down Expand Up @@ -55,15 +55,3 @@ When this option is `true`, the method returns `false` if the stream has already
## Related

- [is-file-stream](https://github.com/jamestalmage/is-file-stream) - Detect if a stream is a file stream

---

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-is-stream?utm_source=npm-is-stream&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
12 changes: 6 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Stream from 'node:stream';
import http from 'node:http';
import net from 'node:net';
import test from 'ava';
import tempy from 'tempy';
import {temporaryFile} from 'tempy';
import {
isStream,
isWritableStream,
Expand All @@ -20,7 +20,7 @@ test('isStream()', t => {
t.true(isStream(new Stream.Transform()));
t.true(isStream(new Stream.PassThrough()));
t.true(isStream(fs.createReadStream('test.js')));
t.true(isStream(fs.createWriteStream(tempy.file())));
t.true(isStream(fs.createWriteStream(temporaryFile())));
t.true(isStream(new http.OutgoingMessage()));
t.true(isStream(new http.IncomingMessage()));
t.true(isStream(new http.ServerResponse({})));
Expand All @@ -37,7 +37,7 @@ test('isWritableStream()', t => {
t.true(isWritableStream(new Stream.Duplex()));
t.true(isWritableStream(new Stream.Transform()));
t.true(isWritableStream(new Stream.PassThrough()));
t.true(isWritableStream(fs.createWriteStream(tempy.file())));
t.true(isWritableStream(fs.createWriteStream(temporaryFile())));
t.true(isWritableStream(new http.OutgoingMessage()));
t.true(isWritableStream(new http.ServerResponse({})));
t.true(isWritableStream(new http.ClientRequest('http://example.com')));
Expand All @@ -62,7 +62,7 @@ test('isReadableStream()', t => {
t.true(isReadableStream(new net.Socket()));
t.false(isReadableStream(new Stream.Stream()));
t.false(isReadableStream(new Stream.Writable()));
t.false(isReadableStream(fs.createWriteStream(tempy.file())));
t.false(isReadableStream(fs.createWriteStream(temporaryFile())));
t.false(isReadableStream(new http.OutgoingMessage()));
t.false(isReadableStream(new http.ServerResponse({})));
t.false(isReadableStream(new http.ClientRequest('http://example.com')));
Expand All @@ -81,7 +81,7 @@ test('isDuplexStream()', t => {
t.false(isDuplexStream(new Stream.Readable()));
t.false(isDuplexStream(new Stream.Writable()));
t.false(isDuplexStream(fs.createReadStream('test.js')));
t.false(isDuplexStream(fs.createWriteStream(tempy.file())));
t.false(isDuplexStream(fs.createWriteStream(temporaryFile())));
t.false(isDuplexStream(new http.OutgoingMessage()));
t.false(isDuplexStream(new http.IncomingMessage()));
t.false(isDuplexStream(new http.ServerResponse({})));
Expand All @@ -100,7 +100,7 @@ test('isTransformStream()', t => {
t.false(isTransformStream(new Stream.Writable()));
t.false(isTransformStream(new Stream.Duplex()));
t.false(isTransformStream(fs.createReadStream('test.js')));
t.false(isTransformStream(fs.createWriteStream(tempy.file())));
t.false(isTransformStream(fs.createWriteStream(temporaryFile())));
t.false(isTransformStream(new http.OutgoingMessage()));
t.false(isTransformStream(new http.IncomingMessage()));
t.false(isTransformStream(new http.ServerResponse({})));
Expand Down

0 comments on commit 42ad38e

Please sign in to comment.