Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You have to ways of getting the FormData and Blobs now #1

Open
jimmywarting opened this issue Jan 20, 2022 · 0 comments
Open

You have to ways of getting the FormData and Blobs now #1

jimmywarting opened this issue Jan 20, 2022 · 0 comments

Comments

@jimmywarting
Copy link

jimmywarting commented Jan 20, 2022

"node-fetch": "^3.1.0",

Hi, 👋
b/c it was possible to retrive the internal FormData class used by 'node-fetch' in a roundabout way

import { Response } from 'node-fetch'
const { constructor: FormData } = await new Response(new URLSearchParams()).formData()

then we felt that it was a bit hacky and it also required top level await support...
so we opted to expose the formdata class instead in v3.2.0 along with the utility fn from the fetch-blob/from.js package

import { FormData, fileFrom } from 'node-fetch'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant