chore: lint · unjs/node-fetch-native@39ec744 (original) (raw)

`` @@ -128,7 +128,7 @@ You can simply import { fetch } from node-fetch-native/proxy with a preconfi

``

128

128

```` ```ts


`129`

`129`

`import { fetch } from "node-fetch-native/proxy";

`

`130`

`130`

``

`131`

``

`-

console.log(await fetch("https://icanhazip.com").then((r) => r.text());

`

``

`131`

`+

console.log(await fetch("https://icanhazip.com").then((r) => r.text()));

`

`132`

`132`

```` ```

133

133

``

134

134

`` ### createFetch utility

``

`@@ -140,7 +140,7 @@ import { createFetch } from "node-fetch-native/proxy";

`

140

140

``

141

141

`const fetch = createFetch({ url: "http://localhost:9080" });

`

142

142

``

143

``

`-

console.log(await fetch("https://icanhazip.com").then((r) => r.text());

`

``

143

`+

console.log(await fetch("https://icanhazip.com").then((r) => r.text()));

`

144

144

```` ```


`145`

`145`

``

`146`

`146`

`` ### `createProxy` utility

``

`@@ -154,7 +154,9 @@ import { createProxy } from "node-fetch-native/proxy";

`

`154`

`154`

`const proxy = createProxy();

`

`155`

`155`

`// const proxy = createProxy({ url: "http://localhost:8080" });

`

`156`

`156`

``

`157`

``

`-

console.log(await fetch("https://icanhazip.com", { ...proxy }).then((r) => r.text());

`

``

`157`

`+

console.log(

`

``

`158`

`+

await fetch("https://icanhazip.com", { ...proxy }).then((r) => r.text()),

`

``

`159`

`+

);

`

`158`

`160`

```` ```

159

161

``

160

162

`` ## Alias to node-fetch

``

`@@ -169,8 +171,8 @@ Using npm [overrides](https://docs.npmjs.com/cli/v8/configuring-npm/package-json

`

169

171

`// package.json

`

170

172

`{

`

171

173

`"overrides": {

`

172

``

`-

"node-fetch": "npm:node-fetch-native@latest"

`

173

``

`-

}

`

``

174

`+

"node-fetch": "npm:node-fetch-native@latest",

`

``

175

`+

},

`

174

176

`}

`

175

177

```` ```


`176`

`178`

``

`@@ -182,8 +184,8 @@ Using yarn [selective dependency resolutions](https://classic.yarnpkg.com/lang/e

`

`182`

`184`

`// package.json

`

`183`

`185`

`{

`

`184`

`186`

`"resolutions": {

`

`185`

``

`-

"node-fetch": "npm:node-fetch-native@latest"

`

`186`

``

`-

}

`

``

`187`

`+

"node-fetch": "npm:node-fetch-native@latest",

`

``

`188`

`+

},

`

`187`

`189`

`}

`

`188`

`190`

```` ```

189

191

``

`@@ -196,9 +198,9 @@ Using pnpm.overrides:

`

196

198

`{

`

197

199

`"pnpm": {

`

198

200

`"overrides": {

`

199

``

`-

"node-fetch": "npm:node-fetch-native@latest"

`

200

``

`-

}

`

201

``

`-

}

`

``

201

`+

"node-fetch": "npm:node-fetch-native@latest",

`

``

202

`+

},

`

``

203

`+

},

`

202

204

`}

`

203

205

```` ```

````

204

206

``