{"name":"append-field","version":"2.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/LinusU/node-append-field.git"},"type":"module","exports":"./index.js","scripts":{"test":"standard && mocha && ts-readme-generator --check"},"devDependencies":{"mocha":"^8.4.0","standard":"^16.0.3","testdata-w3c-json-form":"^0.2.0","ts-readme-generator":"^0.5.2"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"gitHead":"989587c47718f93eb9dc516ea89503fd179aa298","description":"A [W3C HTML JSON forms spec](http://www.w3.org/TR/html-json-forms/) compliant field appender (for lack of a better name). Useful for people implementing `application/x-www-form-urlencoded` and `multipart/form-data` parsers.","bugs":{"url":"https://github.com/LinusU/node-append-field/issues"},"homepage":"https://github.com/LinusU/node-append-field#readme","_id":"append-field@2.0.0","_nodeVersion":"16.5.0","_npmVersion":"7.19.1","dist":{"integrity":"sha512-yUPXgerKgcuwakzrRyklfhX+Ma2aYYMjb+BO2RPUwq+tk928V/i5DFWcCUS3hQhj468N+Ktmwb0tfbEtmfC6WA==","shasum":"5997b4468ec8b87d3344cbe9af244a6853b9f416","tarball":"http://registry-npm.ywwl.com/append-field/download/append-field-2.0.0.tgz","fileCount":9,"unpackedSize":6819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/BcuCRA9TVsSAnZWagAA5dcP/3ciGCHBLwd+e5WDEYEP\nb9VSBoWt9j3HmwgfFZ3cRKkyrbEYCshZw98LaH3U8R2czrtdzjlJVDHRW7fi\n18KO/pz7a1zQ9Pa8VW0AVMiU1kC7Gqy+9S+pVDOd13uxF4zNjnPuNAFce45Y\nfuDUUR4mdzpPCZMcvnrsjog4IyftlawI09yuJ4PPTgkykeU9FX2ZkPTC6rhG\nwyu3FnfWyqEeygKLAFSTNsI3edJ8lCd2d1+KbcqiHR2VuhazRbrMgOf39G5O\nNrH5zPh9B9xJs6SHPC0T5momBmQh9fjAIjsoXMVoSVox3KyPc3NsvVK8XY+T\nrByAeBzHekxTJ5F5zpXQBRTKh9sizrrOmPwu6fbwt9+6xGEYr+/+nJyzn6q/\n87sbMuovaAKWrb4gNDJ2Pwx6rMxZI5Z/j8RJk791n80K7C1SlNgsaK5EjQ7t\nw+KzEz0ah+hcr2Jan3GbcU0jPJiZkIOEJLiEi2gX6dL2sBefr24pj9q2D2Id\nmEi/e7qCg96HNXfyXGoh6+ADmAA3TKg2kLd/vEoMoOHOWplqTrfyL4FTvbWN\nm8UJnsN04bg7nmZZYGw5sU0aiiirO0ILCvtSjDzHb1qq7yei7xCRdkYxPHaQ\n9f9vu0MbVDmq0snZXxvgJs51l67yMgefolc+63S5kXXceEuwVbYUvCwyyNEm\nUBCX\r\n=dDsL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt5g4UO4RBBmaJQyEwY8IR1G/kOe9ixzKErNKIhxb2sAIhAMPqa/3ccy6BpjfNt/pYCUGj97fhI4dvi//H6ERf1Ki+"}],"size":3066,"noattachment":false,"key":"/append-field/-/append-field-2.0.0.tgz"},"_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"directories":{},"maintainers":[{"name":"linusu","email":"linus@folkdatorn.se"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/append-field_2.0.0_1627133741997_0.05348574464682576"},"_hasShrinkwrap":false,"readme":"# `append-field`\n\nA [W3C HTML JSON forms spec](http://www.w3.org/TR/html-json-forms/) compliant\nfield appender (for lack of a better name). Useful for people implementing\n`application/x-www-form-urlencoded` and `multipart/form-data` parsers.\n\nIt works best on objects created with `Object.create(null)`. Otherwise it might\nconflict with variables from the prototype (e.g. `hasOwnProperty`).\n\n## Installation\n\n```sh\nnpm install --save append-field\n```\n\n## Usage\n\n```javascript\nimport appendField from 'append-field'\n\nconst obj = Object.create(null)\n\nappendField(obj, 'pets[0][species]', 'Dahut')\nappendField(obj, 'pets[0][name]', 'Hypatia')\nappendField(obj, 'pets[1][species]', 'Felis Stultus')\nappendField(obj, 'pets[1][name]', 'Billie')\n\nconsole.log(obj)\n```\n\n```text\n{ pets:\n   [ { species: 'Dahut', name: 'Hypatia' },\n     { species: 'Felis Stultus', name: 'Billie' } ] }\n```\n\n## API\n\n### `appendField(store, key, value)`\n\n- `store` (`object`, required)\n- `key` (`string`, required)\n- `value` (`any`, required)\n\nAdds the field named `key` with the value `value` to the object `store`.\n\n## License\n\nMIT\n","publish_time":1627133742160,"_cnpm_publish_time":1627133742160,"dist-tags":{"latest":"2.0.0"}}