Upgrade von node-fetch 2.x auf 3.x
Vergleich der öffentlichen API von node-fetch 2.7.0 und 3.3.2, automatisch aus den TypeScript-Typen berechnet. Eine geänderte Signatur ist ein möglicher Breaking Change, keine Gewissheit.
Zusammenfassung
| Entfernte Importpfade | 1 |
|---|---|
| Entfernte Exporte | 6 |
| Geänderte Signaturen | 5 |
| Entfernte Member von Klassen oder Interfaces | 19 |
| Geänderte Member von Klassen oder Interfaces | 14 |
| Neu als veraltet markiert | 3 |
| Geänderte Anforderungen (engines, Peer-Abhängigkeiten) | 2 |
| Neue Exporte | 7 |
Entfernte Importpfade
| Entfernte Importpfade |
|---|
node-fetch/externals |
Entfernte Exporte
| import | export | kind | Vorher |
|---|---|---|---|
node-fetch | HeaderInit | type | Headers | string[][] | { [key: string]: string | string[]; } |
node-fetch | RequestMode | type | "same-origin" | "cors" | "no-cors" |
node-fetch | RequestCache | type | "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" |
node-fetch | ResponseType | type | "error" | "default" | "cors" | "basic" | "opaque" | "opaqueredirect" |
node-fetch | RequestContext | type | "object" | "audio" | "beacon" | "cspreport" | "download" | "embed" | "eventsource" | "favicon" | "fetch" | "font" | "form" | "frame" | "hyperlink" | "iframe" | "image" | "imageset" | "import" | "internal" | "location" | "manifest" | "ping" | "plugin" | "prefetch" | "script" | "serviceworker" | "sharedworker" | "style" | "subresource" | "track" | "video" | "worker" | "xmlhttprequest" | "xslt" |
node-fetch | RequestCredentials | type | "omit" | "include" | "same-origin" |
Geänderte Signaturen
| export | Vorher | Nachher |
|---|---|---|
node-fetch · Blob | class | any |
node-fetch · Body | class | interface |
node-fetch · default | (url: RequestInfo, init?: RequestInit | undefined): Promise<Response> | (url: URL | RequestInfo, init?: RequestInit | undefined): Promise<Response> |
node-fetch · HeadersInit | Headers | string[][] | { [key: string]: string | string[]; } | Headers | Record<string, string> | Iterable<readonly [string, string]> | Iterable<Iterable<string>> |
node-fetch · RequestInfo | string | Request | URLLike | string | Request |
Entfernte Member von Klassen oder Interfaces
| member | import | Vorher |
|---|---|---|
Body.timeout | node-fetch | number |
Body.textConverted | node-fetch | (): Promise<string> |
Request.port | node-fetch | number | undefined |
Request.agent | node-fetch | any |
Request.follow | node-fetch | number |
Request.context | node-fetch | RequestContext |
Request.counter | node-fetch | number |
Request.timeout | node-fetch | number |
Request.compress | node-fetch | boolean |
Request.hostname | node-fetch | string |
Request.protocol | node-fetch | string |
Request.textConverted | node-fetch | (): Promise<string> |
Response.timeout | node-fetch | number |
Response.textConverted | node-fetch | (): Promise<string> |
RequestInit.timeout | node-fetch | number | undefined |
ResponseInit.url | node-fetch | string | undefined |
ResponseInit.size | node-fetch | number | undefined |
ResponseInit.counter | node-fetch | number | undefined |
ResponseInit.timeout | node-fetch | number | undefined |
Geänderte Member von Klassen oder Interfaces
| member | Vorher | Nachher |
|---|---|---|
Body.body | NodeJS.ReadableStream | any |
Body.json | (): Promise<any> | (): Promise<unknown> |
Body.constructor | (body?: any, opts?: { size?: number | undefined; timeout?: number | undefined; } | undefined): Body | |
Headers.raw | (): { [k: string]: string[]; } | (): Record<string, string[]> |
Headers.forEach | (callback: (value: string, name: string) => void): void | (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void |
Request.body | NodeJS.ReadableStream | any |
Request.json | (): Promise<any> | (): Promise<unknown> |
Request.constructor | (input: RequestInfo, init?: RequestInit | undefined): Request | (input: URL | RequestInfo, init?: RequestInit | undefined): Request |
Response.body | NodeJS.ReadableStream | any |
Response.json | (): Promise<any> | (): Promise<unknown> |
Response.static redirect | (url: string, status: number): Response | (url: string, status?: number | undefined): Response |
AbortError.type | "aborted" | string |
AbortError.constructor | (message: string): AbortError | (message?: string | undefined): AbortError | (message?: string | undefined, options?: ErrorOptions | undefined): AbortError |
FetchError.constructor | (message: string, type: string, systemError?: SystemError | undefined): FetchError | (message: string, type: string, systemError?: Record<string, unknown> | undefined): FetchError |
Neu als veraltet markiert
| export | @deprecated |
|---|---|
node-fetch · Body.buffer | Use `body.arrayBuffer()` instead. |
node-fetch · Request.buffer | Use `body.arrayBuffer()` instead. |
node-fetch · Response.buffer | Use `body.arrayBuffer()` instead. |
Geänderte Anforderungen (engines, Peer-Abhängigkeiten)
| Vorher | Nachher | |
|---|---|---|
engines.node | 4.x || >=6.0.0 | ^12.20.0 || ^14.13.1 || >=16.0.0 |
peerDependencies.encoding | ^0.1.0 | — |
Neue Exporte (7)
| import | export | kind |
|---|---|---|
node-fetch | File | variable |
node-fetch | FormData | variable |
node-fetch | blobFrom | variable |
node-fetch | fileFrom | variable |
node-fetch | blobFromSync | variable |
node-fetch | fileFromSync | variable |
node-fetch | ReferrerPolicy | type |
Häufige Fragen
Welche Breaking Changes gibt es beim Upgrade von node-fetch 2 auf 3?
Zwischen node-fetch 2.7.0 und 3.3.2 hat Vigia 6 entfernte Exporte, 5 geänderte Signaturen und 33 entfernte oder geänderte Member von Klassen oder Interfaces gefunden.
Was wurde in node-fetch 3 als veraltet markiert?
3 Exporte oder Member sind in node-fetch 3.3.2 neu als veraltet markiert.
Für Agenten
GET https://vigia.coredls.cloud/v1/packages/npm/node-fetch/upgrade?from=2.7.0&to=3.3.2