8000 fix: use more node: protocol imports (#1428) · node-fetch/node-fetch@41f53b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41f53b9

Browse files
authored
fix: use more node: protocol imports (#1428)
* fix: use node: protocol * use node: protocol in readme
1 parent f674875 commit 41f53b9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ Cookies are not stored by default. However, cookies can be extracted and passed
295295
The "Node.js way" is to use streams when possible. You can pipe `res.body` to another stream. This example uses [stream.pipeline](https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback) to attach stream error handlers and wait for the download to complete.
296296

297297
```js
298-
import {createWriteStream} from 'fs';
299-
import {pipeline} from 'stream';
300-
import {promisify} from 'util'
298+
import {createWriteStream} from 'node:fs';
299+
import {pipeline} from 'node:stream';
300+
import {promisify} from 'node:util'
301301
import fetch from 'node-fetch';
302302

303303
const streamPipeline = promisify(pipeline);
@@ -517,8 +517,8 @@ See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for
517517
In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
518518

519519
```js
520-
import http from 'http';
521-
import https from 'https';
520+
import http from 'node:http';
521+
import https from 'node:https';
522522

523523
const httpAgent = new http.Agent({
524524
keepAlive: true

src/utils/referrer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {isIP} from 'net';
1+
import {isIP} from 'node:net';
22

33
/**
44
* @external URL

test/utils/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import http from 'http';
2-
import zlib from 'zlib';
3-
import {once} from 'events';
1+
import http from 'node:http';
2+
import zlib from 'node:zlib';
3+
import {once} from 'node:events';
44
import Busboy from 'busboy';
55

66
export default class TestServer {

0 commit comments

Comments
 (0)
0