{"_id":"form-serialize","_rev":"55-fcd46b34f1cf3ec8e012f025b87e5e09","name":"form-serialize","description":"serialize html forms","dist-tags":{"latest":"0.7.2"},"versions":{"0.0.0":{"name":"form-serialize","version":"0.0.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"mocha":"~1.13.0","domify":"~1.0.0","zuul":"~0.2.1"},"scripts":{"test":"zuul --ui tdd test/*.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"testling":{"harness":"mocha-tdd","files":"test/*.js","browsers":["ie/9..latest","chrome/20..latest","firefox/4..latest","safari/5.0..latest"]},"_id":"form-serialize@0.0.0","dist":{"shasum":"e70815db8ddb1e9dfdd413a10152dbd7e3259c67","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.0.0.tgz","integrity":"sha512-gFTc2JZPzErRlWU4Eg/11+fWAuHWc7iZ1EZCX3Ddw0xM0p35F3LJRKv9p9x35GKyu6kFBOHSEfMRDvofgmH6Fw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaaZL+4TjQDr1obMU/nuSSxdARe5xt3dNoPd+2sXKxCQIgUJYDZqlJOmxuYLTyvTipGrqWN5qFRTq6rPVrVM1dgTc="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.1.0":{"name":"form-serialize","version":"0.1.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"mocha":"~1.13.0","domify":"~1.0.0","zuul":"~0.2.1"},"scripts":{"test":"zuul --ui tdd test/*.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"testling":{"harness":"mocha-tdd","files":"test/*.js","browsers":["ie/9..latest","chrome/20..latest","firefox/4..latest","safari/5.0..latest"]},"_id":"form-serialize@0.1.0","dist":{"shasum":"7f9be0899b3faa3c41a02b5a0f0557c398a60aa6","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.1.0.tgz","integrity":"sha512-pN+83bFTFsOMQwzne+ac+WgeGW5LlU8pXY8x8r3Madkv2YfLRY1xMNuetxLHfD3/yJdt6m9OfoW8tQFm1PabRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFN3mzzpm/oej7ZQGCtWNH+BGH7FpUkRzfBS8ZOCpdynAiEAvBHrWL55O+IKcV2T300yT3S2G4RHV0PmMzZLJ3a5J80="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.1.1":{"name":"form-serialize","version":"0.1.1","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"mocha":"~1.13.0","domify":"~1.0.0","zuul":"~0.2.1"},"scripts":{"test":"zuul --ui tdd test/*.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"testling":{"harness":"mocha-tdd","files":"test/*.js","browsers":["ie/9..latest","chrome/20..latest","firefox/4..latest","safari/5.0..latest"]},"_id":"form-serialize@0.1.1","dist":{"shasum":"9ffee84f0f1b042a18bc19b0b88281f2d0371d32","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.1.1.tgz","integrity":"sha512-WqI9KWqrK1LLf7UvyNwwRSp1wMGCfH451IBlVN+ER5YEPP+oaUWbli/f7Tz20+mk3DScOXPzb2bqo6BOMUENaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDYFUi2zVv432vMjkiMOrU6BH0KMyBPT3ewdVQ9Uz5TxAiBiNr1jkfFgR39iIDUpYta2dUlX659rEZ0O2yzDMk55hQ=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.2.0":{"name":"form-serialize","version":"0.2.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.0.4"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.2.0","dist":{"shasum":"e67b45824852114c56e7ce9e501d920cf636dc3d","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.2.0.tgz","integrity":"sha512-tIjh9/XxVvdGEn1ErLBi4N7YmeQK3IRtbWyOEaeo5JrEdchyAetIh0XNYYogqBwzR9T5vPmwW3QZNe0/lE9fvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDF5qoXmgHLTcSr/b7uwoH7hDTi6yW3Mw+lVqDAiYIdaQIgD7WisUDIKqB3HEYBo5jvahbJ/kLHD/2ddtnKvRDR2uE="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.3.0":{"name":"form-serialize","version":"0.3.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.6.4"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.3.0","dist":{"shasum":"0ade9d838fe80548c03251531871db49e3d45149","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.3.0.tgz","integrity":"sha512-No9dcQjao63hnRhuyQ4QIDHyEQLwifkYcQHnscLRlLTYnQ7fEPiq4S5NJh9+kWFNxXqmk7nE8iOSeTv25dJx9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh+LWSEfKFbRgEnOh3gNR+dbbHlEfnX9K4IP2Toj3iewIgaZS66QqZ9393AYMyPz1gLK+SeefW/gPaCiKSH63BbWw="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}]},"0.4.0":{"name":"form-serialize","version":"0.4.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.15.1"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"ba2872238a3d1f7c86b5ddf97e250d26afa7c9ec","homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.4.0","_shasum":"2e08c9c747dab2ecb2db7f1c7a366164c2b432c2","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.10.33","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}],"dist":{"shasum":"2e08c9c747dab2ecb2db7f1c7a366164c2b432c2","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.4.0.tgz","integrity":"sha512-vCO18YHLFyvoiYN52Hnciiu4VMc/wz3Kfi4STAQHrYgkurVy74lgeK++zVYPkgXby/+W2Um5asBfO3txYVE7bA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5j296b0kjxwQmMYDezC+wMq86E6kHW8iWVVvmIdcVOQIgQx8bLZFcBo3NVcWlTlLoI9DvQZMn4w8QkL6gDCL2LpQ="}]}},"0.4.1":{"name":"form-serialize","version":"0.4.1","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.15.1"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"89de4d89ab1d8c0a00024e2929d467e57b51ef66","homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.4.1","_shasum":"391df899009106af0030a3b5ff7a079ac78aa69d","_from":".","_npmVersion":"2.1.12","_nodeVersion":"0.10.33","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}],"dist":{"shasum":"391df899009106af0030a3b5ff7a079ac78aa69d","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.4.1.tgz","integrity":"sha512-ahD9sEHabSrUkF0d3A8z49J1gbGGnBnTKNH8n88Y8A0oJ61EaxmbrW62CmSB3B8kKM4cb9+HEiwJX814U+7kSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICytwdHW1IzsRe4KY44x5exuRshJW73Nbe0lRGNF72mlAiEA0eo2K0NCBu4zpbe03pEPbMxrpnX1Pyr0+5MfEAteYTE="}]}},"0.5.0":{"name":"form-serialize","version":"0.5.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.15.1"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"a3a4af06ef1de58ccb042ad62811df425feefb85","homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.5.0","_shasum":"f966643baa356535ab4dadda1e540d2905dc43d6","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.35","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}],"dist":{"shasum":"f966643baa356535ab4dadda1e540d2905dc43d6","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.5.0.tgz","integrity":"sha512-RjjDr+ZeRmSrFzCjHmws39vWaI3KbdCbIIlqmsaKXi4SP3GOb5lRJ9VdkwDkkGTojKvNIPaJkp6/XxcVH15BPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOs6NTy53HvZ4AaTZbHiKuO3tKEOr3FdFuYOX/AmNoagIhAOLS1aBGQ67Jj1kPyDlHBMkNgnXuBgJzW8SLLcwl1vzz"}]}},"0.6.0":{"name":"form-serialize","version":"0.6.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~1.15.1"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"7d9250047f49206542c15998360cb8d30221b083","homepage":"https://github.com/shtylman/form-serialize","_id":"form-serialize@0.6.0","_shasum":"0dfdaa71038bfc5832632771cff771ac724beca8","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.35","_npmUser":{"name":"shtylman","email":"shtylman@gmail.com"},"maintainers":[{"name":"shtylman","email":"shtylman@gmail.com"}],"dist":{"shasum":"0dfdaa71038bfc5832632771cff771ac724beca8","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.6.0.tgz","integrity":"sha512-jkueJu1nrB+VsnVvbA6OQ92BvxAQAVBQKuEEVc/8uCggKqgvq3ojN2HtPOGFLDxBBhCEXL+mEOUqBigtkyHOEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9QuXBml7YE66wMC23HK82HOMczPYyTa+4YGqTXaG/IAiEA6E3m0heGSvNlbsmkY4/z6aRVQtfGcPAg/zuH11S7Y+g="}]}},"0.7.0":{"name":"form-serialize","version":"0.7.0","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.0.0","zuul":"~3.6.0"},"scripts":{"test":"zuul -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"14f4f22197423a91c90caf59f640a7d3ce60921d","homepage":"https://github.com/shtylman/form-serialize#readme","_id":"form-serialize@0.7.0","_shasum":"b6b6ee98aa47a19ce5036abc2af95e35b7539eae","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"defunctzombie","email":"shtylman@gmail.com"},"dist":{"shasum":"b6b6ee98aa47a19ce5036abc2af95e35b7539eae","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.7.0.tgz","integrity":"sha512-QsTmekMYUqCcgrUwtac5FwHLV0xM4LQ6YjabKo3TuoyTILH4I2oi/w+YntxtXrRiefkcttIB4PPZUdRb2/6pXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQLab4qhL2mnYp4O86X6k2mFiM1FM/awvJc+5CkpSJ0AIgCjHvw2MiwIWBn1fNEK8Kb3yVqQbo21GiY5Ag5TpmKW4="}]},"maintainers":[{"name":"defunctzombie","email":"shtylman@gmail.com"}]},"0.7.1":{"name":"form-serialize","version":"0.7.1","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.4.0","zuul":"~3.10.1"},"scripts":{"test":"zuul -- test/index.js","test-local":"zuul --local -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"ce6a9a98224270ea1d319688f796c22313aa2011","homepage":"https://github.com/shtylman/form-serialize#readme","_id":"form-serialize@0.7.1","_shasum":"48f74e37d041de4f7d140dd2c54b37fff8d2e843","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"defunctzombie","email":"shtylman@gmail.com"},"dist":{"shasum":"48f74e37d041de4f7d140dd2c54b37fff8d2e843","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.7.1.tgz","integrity":"sha512-WGThlbRC1ELTwfR4HGLFnUBU3yzaOmiZ1ZbPgic3XsS3nGTzZdrxOLwsP4kz6QBdy1KAwvoLwN9TJk08mfqxxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYpPEFxzKdpfW8Gq0xPsNBMmAinzB4RMYLNlbVo8Ls8AiEA91SskbLHCsBQE6gfgaaH8YCrQ7ncREQQWGR8iho2Nww="}]},"maintainers":[{"name":"defunctzombie","email":"shtylman@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/form-serialize-0.7.1.tgz_1457713974499_0.5212791729718447"}},"0.7.2":{"name":"form-serialize","version":"0.7.2","description":"serialize html forms","main":"index.js","directories":{"test":"test"},"devDependencies":{"domify":"~1.4.0","zuul":"~3.10.1"},"scripts":{"test":"zuul -- test/index.js","test-local":"zuul --local -- test/index.js"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"keywords":["form","serialize"],"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"gitHead":"56d1890941f9eca33d520141ed6724984b2eaa6b","homepage":"https://github.com/shtylman/form-serialize#readme","_id":"form-serialize@0.7.2","_shasum":"b0a2ff0c22026fb6d3d15c9d33f6de6a432e4732","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.1","_npmUser":{"name":"defunctzombie","email":"shtylman@gmail.com"},"dist":{"shasum":"b0a2ff0c22026fb6d3d15c9d33f6de6a432e4732","tarball":"https://registry.npmjs.org/form-serialize/-/form-serialize-0.7.2.tgz","integrity":"sha512-ohEA4Crzd/+hSREjGf4kSsy73WhAtQ7H+blGEz2DVd+JCi0TV5nZBSn9PaPlvrl9m29fa6xclAfpRkqZ57b1bw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvkvkTWwmXIomxW2B4fMbxPMc4Os6yyOJLwmAF607QWwIgLmt0AVQtAFWy9USHhLnGpDL4oEIbpDDnSjhxjxgLBS4="}]},"maintainers":[{"name":"defunctzombie","email":"shtylman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/form-serialize-0.7.2.tgz_1497227016512_0.7772415708750486"}}},"readme":"# form-serialize [![Build Status](https://travis-ci.org/defunctzombie/form-serialize.png?branch=master)](https://travis-ci.org/defunctzombie/form-serialize)\n\nserialize form fields to submit a form over ajax\n\n## install\n\n```shell\nnpm install form-serialize\n```\n\n## use\n\nform-serialize supports two output formats, url encoded (default) or hash (js objects).\n\nLets serialize the following html form:\n```html\n<form id=\"example-form\">\n\t<input type=\"text\" name=\"foo\" value=\"bar\"/>\n\t<input type=\"submit\" value=\"do it!\"/>\n</form>\n```\n\n```js\nvar serialize = require('form-serialize');\nvar form = document.querySelector('#example-form');\n\nvar str = serialize(form);\n// str -> \"foo=bar\"\n\nvar obj = serialize(form, { hash: true });\n// obj -> { foo: 'bar' }\n```\n\n## api\n\n### serialize(form [, options])\n\nReturns a serialized form of a HTMLForm element. Output is determined by the serializer used. Default serializer is url-encoded.\n\narg | type | desc\n:--- | :--- | :---\nform | HTMLForm | must be an HTMLForm element\noptions | Object | optional options object\n\n#### options\n\noption | type | default | desc\n:--- | :--- | :---: | :---\nhash | boolean | false | if `true`, the hash serializer will be used for `serializer` option\nserializer | function | url-encoding | override the default serializer (hash or url-encoding)\ndisabled | boolean | false | if `true`, disabled fields will also be serialized\nempty | boolean | false | if `true`, empty fields will also be serialized\n\n### custom serializer\n\nSerializers take 3 arguments: `result`, `key`, `value` and should return a newly updated result.\n\nSee the example serializers in the index.js source file.\n\n## notes\n\nonly [successful control](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2) form fields are serialized (with the exception of disabled fields if disabled option is set)\n\nmultiselect fields with more than one value will result in an array of values in the `hash` output mode using the default hash serializer\n\n### explicit array fields\n\nFields who's name ends with `[]` are **always** serialized as an array field in `hash` output mode using the default hash serializer.\nThe field name also gets the brackets removed from its name.\n\nThis does not affect `url-encoding` mode output in any way.\n\n```html\n<form id=\"example-form\">\n\t<input type=\"checkbox\" name=\"foo[]\" value=\"bar\" checked />\n\t<input type=\"checkbox\" name=\"foo[]\" value=\"baz\" />\n\t<input type=\"submit\" value=\"do it!\"/>\n</form>\n```\n\n```js\nvar serialize = require('form-serialize');\nvar form = document.querySelector('#example-form');\n\nvar obj = serialize(form, { hash: true });\n// obj -> { foo: ['bar'] }\n\nvar str = serialize(form);\n// str -> \"foo[]=bar\"\n\n```\n\n### indexed arrays\n\nAdding numbers between brackets for the array notation above will result in a hash serialization with explicit ordering based on the index number regardless of element ordering.\n\nLike the \"[explicit array fields](explicit-array-fields)\" this does not affect url-encoding mode output in any way.\n\n```html\n<form id=\"todos-form\">\n\t<input type=\"text\" name=\"todos[1]\" value=\"milk\" />\n\t<input type=\"text\" name=\"todos[0]\" value=\"eggs\" />\n\t<input type=\"text\" name=\"todos[2]\" value=\"flour\" />\n</form>\n```\n\n```js\nvar serialize = require('form-serialize');\nvar form = document.querySelector('#todos-form');\n\nvar obj = serialize(form, { hash: true });\n// obj -> { todos: ['eggs', 'milk', 'flour'] }\n\nvar str = serialize(form);\n// str -> \"todos[1]=milk&todos[0]=eggs&todos[2]=flour\"\n\n```\n\n### nested objects\n\nSimilar to the indexed array notation, attribute names can be added by inserting a string value between brackets. The notation can be used to create deep objects and mixed with the array notation.\n\nLike the \"[explicit array fields](explicit-array-fields)\" this does not affect url-encoding mode output.\n\n```html\n<form id=\"nested-example\">\n\t<input type=\"text\" name=\"foo[bar][baz]\" value=\"qux\" />\n\t<input type=\"text\" name=\"foo[norf][]\" value=\"item 1\" />\n</form>\n```\n\n```js\nvar serialize = require('form-serialize');\nvar form = document.querySelector('#todos-form');\n\nvar obj = serialize(form, { hash: true });\n// obj -> { foo: { bar: { baz: 'qux' } }, norf: [ 'item 1' ] }\n\n```\n\n## references\n\nThis module is based on ideas from jQuery serialize and the Form.serialize method from the prototype library\n\n## license\n\nMIT\n","maintainers":[{"name":"defunctzombie","email":"shtylman@gmail.com"}],"time":{"modified":"2022-06-18T03:01:54.621Z","created":"2013-10-12T18:32:30.338Z","0.0.0":"2013-10-12T18:32:31.618Z","0.1.0":"2013-10-13T01:07:28.807Z","0.1.1":"2013-10-27T01:20:58.219Z","0.2.0":"2013-12-05T14:27:30.317Z","0.3.0":"2014-05-01T14:39:56.929Z","0.4.0":"2014-12-17T01:52:28.074Z","0.4.1":"2015-01-15T17:29:17.246Z","0.5.0":"2015-02-09T02:45:53.135Z","0.6.0":"2015-02-23T17:11:54.025Z","0.7.0":"2015-10-17T18:50:15.485Z","0.7.1":"2016-03-11T16:32:54.928Z","0.7.2":"2017-06-12T00:23:36.641Z"},"author":{"name":"Roman Shtylman","email":"shtylman@gmail.com"},"repository":{"type":"git","url":"git://github.com/shtylman/form-serialize.git"},"homepage":"https://github.com/shtylman/form-serialize#readme","keywords":["form","serialize"],"bugs":{"url":"https://github.com/shtylman/form-serialize/issues"},"license":"MIT","readmeFilename":"README.md","users":{"ash":true,"barwin":true,"maximilianschmitt":true,"aaronhans":true,"nackjicholson":true,"viz":true,"dvk":true,"coryrobinson42":true,"keithmorris":true,"nickytonline":true,"alimaster":true,"isa424":true,"usex":true,"muhammadghazali":true,"giovannif23":true,"stephenoconnor":true,"majioa":true,"zuojiang":true,"sherylhohman":true,"andre_scalco":true,"kvrao":true,"pantyuhind":true,"71emj1":true,"ostgals":true}}