{"id":36924280,"url":"https://github.com/jimmywarting/FormData","last_synced_at":"2026-01-28T10:01:03.864Z","repository":{"id":44939679,"uuid":"71378225","full_name":"jimmywarting/FormData","owner":"jimmywarting","description":"HTML5 `FormData` polyfill for Browsers and nodejs","archived":false,"fork":false,"pushed_at":"2024-03-06T09:18:04.000Z","size":448,"stargazers_count":360,"open_issues_count":4,"forks_count":105,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-01-18T06:07:05.475Z","etag":null,"topics":["formdata","html5","polyfill"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimmywarting.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jimmywarting"],"custom":["https://paypal.me/jimmywarting","https://jimmy.warting.se/opensource"]}},"created_at":"2016-10-19T16:41:21.000Z","updated_at":"2026-01-12T05:51:57.000Z","dependencies_parsed_at":"2024-06-18T11:27:32.321Z","dependency_job_id":null,"html_url":"https://github.com/jimmywarting/FormData","commit_stats":{"total_commits":180,"total_committers":21,"mean_commits":8.571428571428571,"dds":"0.18888888888888888","last_synced_commit":"820421ba9ee291cbf6b1b21aaa14ae1846d7c66c"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/jimmywarting/FormData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmywarting%2FFormData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmywarting%2FFormData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmywarting%2FFormData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmywarting%2FFormData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmywarting","download_url":"https://codeload.github.com/jimmywarting/FormData/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmywarting%2FFormData/sbom","scorecard":{"id":520876,"data":{"date":"2025-08-11","repo":{"name":"github.com/jimmywarting/FormData","commit":"820421ba9ee291cbf6b1b21aaa14ae1846d7c66c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jimmywarting/FormData/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jimmywarting/FormData/release.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":3,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/jimmywarting/.github/SECURITY.md:1","Warn: no linked content found","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: github.com/jimmywarting/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T02:59:10.655Z","repository_id":44939679,"created_at":"2025-08-20T02:59:10.655Z","updated_at":"2025-08-20T02:59:10.655Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28710111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T23:51:44.727Z","status":"online","status_checked_at":"2026-01-24T02:00:06.909Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formdata","html5","polyfill"],"created_at":"2026-01-12T19:00:25.492Z","updated_at":"2026-01-28T10:01:03.858Z","avatar_url":"https://github.com/jimmywarting.png","language":"JavaScript","readme":"\u003e **Note:** FormData is built in to NodeJS v18 globally so that you no longer need this.\n\n### A `FormData` polyfill for the browser ...and a module for NodeJS (`New!`)\n\n```bash\nnpm install formdata-polyfill\n```\n\nThe browser polyfill will likely have done its part already, and i hope you stop supporting old browsers c\",)\u003cbr\u003e\nBut NodeJS still lacks a proper FormData\u003cbr\u003eThe good old form-data package is a very old and isn't spec compatible and does some abnormal stuff to construct and read FormData instances that other http libraries are not happy about when it comes to follow the spec.\n\n### The NodeJS / ESM version\n- The modular (~2.3 KiB minified uncompressed) version of this package is independent of any browser stuff and don't patch anything\n- It's as pure/spec compatible as it possible gets the test are run by WPT.\n- It's compatible with [node-fetch](https://github.com/node-fetch/node-fetch).\n- It have higher platform dependencies as it uses classes, symbols, ESM \u0026 private fields\n- Only dependency it has is [fetch-blob](https://github.com/node-fetch/fetch-blob)\n\n```js\n// Node example\nimport fetch from 'node-fetch'\nimport File from 'fetch-blob/file.js'\nimport { fileFromSync } from 'fetch-blob/from.js'\nimport { FormData } from 'formdata-polyfill/esm.min.js'\n\nconst file = fileFromSync('./README.md')\nconst fd = new FormData()\n\nfd.append('file-upload', new File(['abc'], 'hello-world.txt'))\nfd.append('file-upload', file)\n\n// it's also possible to append file/blob look-a-like items\n// if you have streams coming from other destinations\nfd.append('file-upload', {\n  size: 123,\n  type: '',\n  name: 'cat-video.mp4',\n  stream() { return stream },\n  [Symbol.toStringTag]: 'File'\n})\n\nfetch('https://httpbin.org/post', { method: 'POST', body: fd })\n```\n\n----\n\nIt also comes with way to convert FormData into Blobs - it's not something that every developer should have to deal with.\nIt's mainly for [node-fetch](https://github.com/node-fetch/node-fetch) and other http library to ease the process of serializing a FormData into a blob and just wish to deal with Blobs instead (Both Deno and Undici adapted a version of this [formDataToBlob](https://github.com/jimmywarting/FormData/blob/5ddea9e0de2fc5e246ab1b2f9d404dee0c319c02/formdata-to-blob.js) to the core and passes all WPT tests run by the browser itself)\n```js\nimport { Readable } from 'node:stream'\nimport { FormData, formDataToBlob } from 'formdata-polyfill/esm.min.js'\n\nconst blob = formDataToBlob(new FormData())\nfetch('https://httpbin.org/post', { method: 'POST', body: blob })\n\n// node built in http and other similar http library have to do:\nconst stream = Readable.from(blob.stream())\nconst req = http.request('http://httpbin.org/post', {\n  method: 'post',\n  headers: {\n    'Content-Length': blob.size,\n    'Content-Type': blob.type\n  }\n})\nstream.pipe(req)\n```\n\nPS: blob \u0026 file that are appended to the FormData will not be read until any of the serialized blob read-methods gets called\n...so uploading very large files is no biggie\n\n### Browser polyfill\n\nusage:\n\n```js\nimport 'formdata-polyfill' // that's it\n```\n\nThe browser polyfill conditionally replaces the native implementation rather than fixing the missing functions,\nsince otherwise there is no way to get or delete existing values in the FormData object.\nTherefore this also patches `XMLHttpRequest.prototype.send` and `fetch` to send the `FormData` as a blob,\nand `navigator.sendBeacon` to send native `FormData`.\n\nI was unable to patch the Response/Request constructor\nso if you are constructing them with FormData then you need to call `fd._blob()` manually.\n\n```js\nnew Request(url, {\n  method: 'post',\n  body: fd._blob ? fd._blob() : fd\n})\n```\n\nDependencies\n---\n\nIf you need to support IE \u003c= 9 then I recommend you to include eligrey's [blob.js]\n(which i hope you don't - since IE is now dead)\n\n\u003cdetails\u003e\n    \u003csummary\u003eUpdating from 2.x to 3.x\u003c/summary\u003e\n\nPreviously you had to import the polyfill and use that,\nsince it didn't replace the global (existing) FormData implementation.\nBut now it transparently calls `_blob()` for you when you are sending something with fetch or XHR,\nby way of monkey-patching the `XMLHttpRequest.prototype.send` and `fetch` functions.\n\nSo you maybe had something like this:\n\n```javascript\nvar FormData = require('formdata-polyfill')\nvar fd = new FormData(form)\nxhr.send(fd._blob())\n```\n\nThere is no longer anything exported from the module\n(though you of course still need to import it to install the polyfill),\nso you can now use the FormData object as normal:\n\n```javascript\nrequire('formdata-polyfill')\nvar fd = new FormData(form)\nxhr.send(fd)\n```\n\n\u003c/details\u003e\n\n\n\nNative Browser compatibility (as of 2021-05-08)\n---\nBased on this you can decide for yourself if you need this polyfill.\n\n[![screenshot](https://user-images.githubusercontent.com/1148376/117550329-0993aa80-b040-11eb-976c-14e31f1a3ba4.png)](https://developer.mozilla.org/en-US/docs/Web/API/FormData#Browser_compatibility)\n\n\n\nThis normalizes support for the FormData API:\n\n - `append` with filename\n - `delete()`, `get()`, `getAll()`, `has()`, `set()`\n - `entries()`, `keys()`, `values()`, and support for `for...of`\n - Available in web workers (just include the polyfill)\n\n  [npm-image]: https://img.shields.io/npm/v/formdata-polyfill.svg\n  [npm-url]: https://www.npmjs.com/package/formdata-polyfill\n  [blob.js]: https://github.com/eligrey/Blob.js\n","funding_links":["https://github.com/sponsors/jimmywarting","https://paypal.me/jimmywarting","https://jimmy.warting.se/opensource"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmywarting%2FFormData","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmywarting%2FFormData","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmywarting%2FFormData/lists"}