Can I use FormData in node-fetch using commonJS ? #1597
Replies: 2 comments 3 replies
-
I think // commonjs file
import('node-fetch').then(mod => {
const { default: fetch, FormData } = mod
const fd = new FormData()
}) more over here: #1279 Alt you could use the built in fetch/FormData from NodeJS itself. they shipped it in NodeJS v18.x I just so happens to know that their |
Beta Was this translation helpful? Give feedback.
-
I believe Check out form-data package on npm.js for further information. // import from form-data instead of node-fetch
import FormData from "form-data";
const form_data = new FormData();
form_data.append("name", "someone"); |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using
"node-fetch": "^2.6.7" version for support commonJS.
I want to use FormData via commonJS syntax which support in esm like
import { FormData } from "node-fetch"
is it possible?
Beta Was this translation helpful? Give feedback.
All reactions