Package to replace
form-data
Suggested replacement(s)
In many (if not most) cases, the native FormData (https://nodejs.org/docs/latest/api/globals.html#class-formdata, https://developer.mozilla.org/en-US/docs/Web/API/FormData) could be used instead with no change.
There are some usages of the form-data library that require some code changes though:
- using streams or directly a
Buffer: those need to be turned into a Blob (possibly through node:stream/consumers)
- the
submit() method: can be replaced with fetch()
- a few other specific methods that might not all have replacements (e.g. getBoundary/setBoundary)
Manifest type
native (replaceable by a built-in platform feature)
Rationale
The package mostly duplicates the native FormData
Availability
Node v18 without flags, v21 as non-experimental.
In browsers for 14 years!
Code example (optional)
Package to replace
form-data
Suggested replacement(s)
In many (if not most) cases, the native
FormData(https://nodejs.org/docs/latest/api/globals.html#class-formdata, https://developer.mozilla.org/en-US/docs/Web/API/FormData) could be used instead with no change.There are some usages of the
form-datalibrary that require some code changes though:Buffer: those need to be turned into aBlob(possibly throughnode:stream/consumers)submit()method: can be replaced withfetch()Manifest type
native (replaceable by a built-in platform feature)
Rationale
The package mostly duplicates the native
FormDataAvailability
Node v18 without flags, v21 as non-experimental.
In browsers for 14 years!
Code example (optional)