1. License
“Permission is hereby granted, free of charge, to any person obtaining a copy”
Any use, including paid and closed-source apps.
github.com/form-data/form-data/blob/master/License2. Maintained
github.com/form-data/form-data3. Used by agents' projects
Dependency in 31 public GitHub projects set up for AI coding agents that we scanned (0.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What form-data does
form-data is a small free Node.js library that packs text fields and files into the same format a web form uses for uploads. Your server can then send a photo, a PDF or an audio file to another service, for example a storage or AI service. Newer Node.js versions have this built in, so new code often does not need it.
What people build with it
Pass an upload on to another service
Your server receives a file and forwards it, together with a few text fields, to a storage, email or AI service that expects a form upload.
Send big files without loading them whole
A long video or a large archive is read from disk piece by piece while it is sent, so the server's memory stays small.
Upload a file with axios on the server
Your Node.js code already uses axios; form-data builds the upload body and the matching header for it.
Uploads with Node's own http module
Older code that talks to services through Node's built-in http module can stream the form straight into the request.
Send a voice note for transcription Idea
A chat bot receives a voice message and posts the audio file to a speech-to-text service from the server.
Tell the service the upload size
Some services refuse uploads without a size in the header; form-data can work it out before sending.
form-data popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How form-data is used
- form-data is a dependency in 31 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.6% of the 4,867 JavaScript/TypeScript ones), #18 of 126 in http clients and networking.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 144; those are left out of every share on this page.
- Projects that use it most often also use Axios (67.7%), dotenv (64.5%), date-fns (45.2%).
By coding agent
Often used with
More about form-data
More in HTTP clients and networking
Alternatives
form-data This page
Pick undici (or the fetch and FormData built into Node.js, which are based on it) for new code on Node.js 18 or newer.
Pick got when you want one Node.js request library with retries and streams around your uploads.
Pick needle when you want a light Node.js request library that handles form uploads itself.
Get started
Tell your AI assistant
“In this Node.js server, post the uploaded file to the other service with form-data@4.0.6 (fs.createReadStream + form.getHeaders()), or with the built-in FormData and fetch if the project runs Node 18 or newer.”
Install it in your Node.js project (pin 4.0.6 or newer).
npm install --save form-dataBuild the form with append(), then send it with submit() or hand it to your HTTP library with getHeaders().
var form = new FormData(); form.append('my_string', 'Hello World'); form.submit('http://example.com/', function (err, res) { // res – response object (http.IncomingMessage) // res.resume(); } );
Mistakes to avoid
Old versions picked field separators with Math.random(), which an attacker could predict to add extra fields to a request.
The receiving server needs the boundary from the Content-Type header to split the fields.
getBuffer works only for values a Buffer can hold.
The Buffer constructor is deprecated in Node.js and prints a warning.
The library does not accept arrays as values.
Questions
Do I still need form-data on Node.js 18 or newer?
Often not. Node.js has its own FormData and fetch; form-data still helps with streaming big files and with older code built on axios or http.
Which version is safe?
4.0.4 or newer (4.0.6 is current). Older 4.x, 3.x before 3.0.4 and 2.x before 2.5.4 picked field separators with a guessable random number.
Can I get the whole body as one piece to send?
Yes, getBuffer() returns it, but only for text and buffers, not for file streams.
Can I use it in a paid product?
Yes, it is MIT-licensed.