{"id":13836109,"url":"https://github.com/fastify/fastify-formbody","last_synced_at":"2025-05-14T22:09:46.614Z","repository":{"id":24882689,"uuid":"102674699","full_name":"fastify/fastify-formbody","owner":"fastify","description":"A Fastify plugin to parse x-www-form-urlencoded bodies","archived":false,"fork":false,"pushed_at":"2025-05-01T15:03:24.000Z","size":175,"stargazers_count":132,"open_issues_count":0,"forks_count":19,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-07T15:02:46.429Z","etag":null,"topics":["fastify","fastify-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@fastify/formbody","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/fastify.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null},"funding":{"github":"fastify","open_collective":"fastify"}},"created_at":"2017-09-07T01:12:42.000Z","updated_at":"2025-05-01T15:03:22.000Z","dependencies_parsed_at":"2024-03-18T12:03:35.158Z","dependency_job_id":"9e1bd3a7-0cf5-4428-b24b-af5ffb4e64e9","html_url":"https://github.com/fastify/fastify-formbody","commit_stats":{"total_commits":176,"total_committers":34,"mean_commits":5.176470588235294,"dds":0.6988636363636364,"last_synced_commit":"6138d3f2e522227197886c5da3de4d61cf76515a"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-formbody","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-formbody/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-formbody/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-formbody/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","download_url":"https://codeload.github.com/fastify/fastify-formbody/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253365316,"owners_count":21897181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fastify","fastify-plugin"],"created_at":"2024-08-04T15:00:35.738Z","updated_at":"2025-05-14T22:09:41.594Z","avatar_url":"https://github.com/fastify.png","language":"JavaScript","readme":"# @fastify/formbody\n\n[![CI](https://github.com/fastify/fastify-formbody/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/fastify-formbody/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@fastify/formbody.svg?style=flat)](https://www.npmjs.com/package/@fastify/formbody)\n[![NPM downloads](https://img.shields.io/npm/dm/fastify-formbody.svg?style=flat)](https://www.npmjs.com/package/@fastify/formbody)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\nA simple plugin for [Fastify][fastify] that adds a content type parser for\nthe content type `application/x-www-form-urlencoded`.\n\n[fastify]: https://fastify.dev/\n\n## Install\n\n```\nnpm i @fastify/formbody\n```\n\n\n### Compatibility\n| Plugin version | Fastify version |\n| ---------------|-----------------|\n| `^8.x`         | `^5.x`          |\n| `^7.x`         | `^4.x`          |\n| `^6.x`         | `^3.x`          |\n| `^3.x`         | `^2.x`          |\n| `^2.x`         | `^1.x`          |\n\n\nPlease note that if a Fastify version is out of support, then so are the corresponding versions of this plugin\nin the table above.\nSee [Fastify's LTS policy](https://github.com/fastify/fastify/blob/main/docs/Reference/LTS.md) for more details.\n\n## Example\n\nGiven the following code:\n\n```js\nconst fastify = require('fastify')()\n\nfastify.register(require('@fastify/formbody'))\n\nfastify.post('/', (req, reply) =\u003e {\n  reply.send(req.body)\n})\n\nfastify.listen({ port: 8000 }, (err) =\u003e {\n  if (err) throw err\n})\n```\n\nAnd a `POST` body of:\n\n```html\nfoo=foo\u0026bar=bar\u0026answer=42\n```\n\nThe sent reply would be the object:\n\n```js\n{\n  foo: 'foo',\n  bar: 'bar',\n  answer: 42\n}\n```\n\n## Options\n\nThe plugin accepts an options object with the following properties:\n\n+ `bodyLimit`: The maximum amount of bytes to process\nbefore returning an error. If the limit is exceeded, a `500` error will be\nreturned immediately. When set to `undefined` the limit will be set to whatever\nis configured on the parent Fastify instance. The default value is\nwhatever is configured in\n[fastify](https://github.com/fastify/fastify/blob/main/docs/Reference/Server.md#bodylimit)\n (`1048576` by default).\n+ `parser`: The default parser used is the querystring.parse built-in.  You can change this default by passing a parser function e.g. `fastify.register(require('@fastify/formbody'), { parser: str =\u003e myParser(str) })`\n\n## Upgrading from 4.x\n\nPreviously, the external [qs lib](https://github.com/ljharb/qs) was used that did things like parse nested objects. For example:\n\n- ***Input:*** `foo[one]=foo\u0026foo[two]=bar`\n- ***Parsed:*** `{ foo: { one: 'foo', two: 'bar' } }`\n\nThe way this is handled now using the built-in querystring.parse:\n\n- ***Input:*** `foo[one]=foo\u0026foo[two]=bar`\n- ***Parsed:*** `{ 'foo[one]': 'foo', 'foo[two]': 'bar' }`\n\nIf you need nested parsing, you must configure it manually by installing the qs lib (`npm i qs`), and then configure an optional parser:\n\n```js\nconst fastify = require('fastify')()\nconst qs = require('qs')\nfastify.register(require('@fastify/formbody'), { parser: str =\u003e qs.parse(str) })\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"categories":["\u003ch2 align=\"center\"\u003eAwesome Fastify\u003c/h2\u003e"],"sub_categories":["\u003ch2 align=\"center\"\u003eEcosystem\u003c/h2\u003e"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffastify-formbody","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastify%2Ffastify-formbody","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffastify-formbody/lists"}