{"_id":"form-data2","_rev":"12-b08cc89360f447afc55eefd27f4cda66","name":"form-data2","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"form-data2","version":"1.0.0","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/joepie91/node-form-data2"},"keywords":["form-data","multipart","http","stream"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"gulp":"~3.8.0","gulp-cached":"~0.0.3","gulp-coffee":"~2.0.1","gulp-concat":"~2.2.0","gulp-livereload":"~2.1.0","gulp-nodemon":"~1.0.4","gulp-plumber":"~0.6.3","gulp-remember":"~0.2.0","gulp-rename":"~1.2.0","gulp-util":"~2.2.17"},"dependencies":{"bluebird":"^2.8.2","combined-stream2":"^1.0.2","debug":"^2.1.1","lodash":"^2.4.1","mime":"^1.2.11","uuid":"^2.0.1"},"gitHead":"fd13f88463d2dcafacd38cfcd31c4ebbd1118b86","bugs":{"url":"https://github.com/joepie91/node-form-data2/issues"},"homepage":"https://github.com/joepie91/node-form-data2","_id":"form-data2@1.0.0","_shasum":"b6894aeda36f9671b8a7e66371c87508a0625607","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"dist":{"shasum":"b6894aeda36f9671b8a7e66371c87508a0625607","tarball":"https://registry.npmjs.org/form-data2/-/form-data2-1.0.0.tgz","integrity":"sha512-/N6zZODw3CFYpTqUhQ4qJLLZbmFdK4igp/jDiUwr8M0qhnk/vRyfH1ixfMmUPVMIvW5qs17EEKtdfSV3WTsT4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+53dAxLlmXwz9JVmP/xLfuJ/ODR48WHNaB4WWYxDuZAiBWED+u6ZzhyBRPoHq3p3cd/rhFploeykxgK3woswlZ4A=="}]},"directories":{}},"1.0.1":{"name":"form-data2","version":"1.0.1","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/joepie91/node-form-data2"},"keywords":["form-data","multipart","http","stream"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"gulp":"~3.8.0","gulp-cached":"~0.0.3","gulp-coffee":"~2.0.1","gulp-concat":"~2.2.0","gulp-livereload":"~2.1.0","gulp-nodemon":"~1.0.4","gulp-plumber":"~0.6.3","gulp-remember":"~0.2.0","gulp-rename":"~1.2.0","gulp-util":"~2.2.17"},"dependencies":{"bluebird":"^2.8.2","combined-stream2":"^1.0.2","debug":"^2.1.1","lodash":"^2.4.1","mime":"^1.2.11","uuid":"^2.0.1"},"gitHead":"9a8f1e2f7cc53f4e515a0c1002b97507d03946ba","bugs":{"url":"https://github.com/joepie91/node-form-data2/issues"},"homepage":"https://github.com/joepie91/node-form-data2","_id":"form-data2@1.0.1","_shasum":"b42acbf942d68bb907aa4a9379ccd49d7bc53393","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"dist":{"shasum":"b42acbf942d68bb907aa4a9379ccd49d7bc53393","tarball":"https://registry.npmjs.org/form-data2/-/form-data2-1.0.1.tgz","integrity":"sha512-ASVCXLXg9m4ocM0LkGo8ru2/BSqPaLTbz5rqIdfzMe+2HoHbs/T17jlvh7hoQQmIHX57rrd0jvZfrjLgoCh+hA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBItwxysEFuvOrUQJYMn2gZr8/A6/Ld6PiDwhL9I3axgIgDOwuyhT6l4JzDOkDevXoDWFpDYWaTWzu5273k1HBxwk="}]},"directories":{}},"1.0.2":{"name":"form-data2","version":"1.0.2","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/joepie91/node-form-data2"},"keywords":["form-data","multipart","http","stream"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"gulp":"~3.8.0","gulp-cached":"~0.0.3","gulp-coffee":"~2.0.1","gulp-concat":"~2.2.0","gulp-livereload":"~2.1.0","gulp-nodemon":"~1.0.4","gulp-plumber":"~0.6.3","gulp-remember":"~0.2.0","gulp-rename":"~1.2.0","gulp-util":"~2.2.17"},"dependencies":{"bluebird":"^2.8.2","combined-stream2":"^1.0.2","debug":"^2.1.1","lodash":"^2.4.1","mime":"^1.2.11","uuid":"^2.0.1"},"gitHead":"29d17c126a26c429b2ba536dcc14568bce5ef976","bugs":{"url":"https://github.com/joepie91/node-form-data2/issues"},"homepage":"https://github.com/joepie91/node-form-data2","_id":"form-data2@1.0.2","_shasum":"0bdbdc6fbed416e78fe5b1d9767068ca56390ae1","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"dist":{"shasum":"0bdbdc6fbed416e78fe5b1d9767068ca56390ae1","tarball":"https://registry.npmjs.org/form-data2/-/form-data2-1.0.2.tgz","integrity":"sha512-rLWW63WePzPbtayqm/xYmzDQBBJVKfXuJ77EzsoB9EJUvtLzv7ovwK3+TPQGE0PT/Kmtvgi8S4JpJAoYzQ81OA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbQxe9QqMbWXu+lNl4qaenM6IFQCIB2IVWEMWU0J9IIAiAvvtW4euL5l+vRGRACyOgWgHKIfEjCx+avG8gjqLk4TQ=="}]},"directories":{}},"1.0.3":{"name":"form-data2","version":"1.0.3","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/joepie91/node-form-data2"},"keywords":["form-data","multipart","http","stream"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"gulp":"~3.8.0","gulp-cached":"~0.0.3","gulp-coffee":"~2.0.1","gulp-concat":"~2.2.0","gulp-livereload":"~2.1.0","gulp-nodemon":"~1.0.4","gulp-plumber":"~0.6.3","gulp-remember":"~0.2.0","gulp-rename":"~1.2.0","gulp-util":"~2.2.17"},"dependencies":{"bluebird":"^2.8.2","combined-stream2":"^1.0.2","debug":"^2.1.1","lodash":"^2.4.1","mime":"^1.2.11","uuid":"^2.0.1"},"gitHead":"dd56e50ad6f26dda8f5ed19a55574acd27a1a272","bugs":{"url":"https://github.com/joepie91/node-form-data2/issues"},"homepage":"https://github.com/joepie91/node-form-data2","_id":"form-data2@1.0.3","_shasum":"cba5e23601a6944d95ab7d7111ff9397a5cb2a4d","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.12.0","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"dist":{"shasum":"cba5e23601a6944d95ab7d7111ff9397a5cb2a4d","tarball":"https://registry.npmjs.org/form-data2/-/form-data2-1.0.3.tgz","integrity":"sha512-OS+/59ZJMCKEbMAKzT7RIWs6iUKutuqHFtF/RaCvgNOtztlzfY/kBBsNc2SrpYItNA90W6fWeQkjfU1Glqayew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV8PzySLKSZH2fU1J0dexZKIUKt9U9YnNTThVnZlP2cQIgWVwxdT+bP5XDNS+rZJlpjqA3Dlq9dFsnqMuRsmHjwgM="}]},"directories":{}},"1.0.4":{"name":"form-data2","version":"1.0.4","description":"A Streams2-compatible drop-in replacement for the `form-data` module.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel --watch src/form-data2.js --out-file lib/form-data2.js"},"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-form-data2.git"},"keywords":["form-data","multipart","http","stream"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","@joepie91/eslint-config":"^1.1.0","eslint":"^6.8.0"},"dependencies":{"bluebird":"^2.8.2","combined-stream2":"^1.0.2","debug":"^2.1.1","mime":"^1.3.4","uuid":"^2.0.1"},"gitHead":"384cff7523dc1ec8085d7d4dd119f8e587fb5396","_id":"form-data2@1.0.4","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-buz4C3F6/7Vpdxt7dNU/tSfjQO/5z9Pyjfb43VhlVvSos5zVhCcMuW9sF1yJ2FdxZRCD2sWQ9WhqUiYLt+AUVQ==","shasum":"9f91ebd83003f9e117f94f1ebd72665ae0b49a40","tarball":"https://registry.npmjs.org/form-data2/-/form-data2-1.0.4.tgz","fileCount":8,"unpackedSize":23230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSzKWCRA9TVsSAnZWagAAdCwP/07RxURLOLlLQiSc70Bt\ngwdrmlpbpSFJw6pSRkdiHHLX1ughhBEz3nGVXcWFkx8C+4ZGSaUpfhprl/A/\n0THCJCOJGfOpVoiilbY8f1QdXr2uLTpBXMtCW616XC7rrHdUNp2sphvqwAxI\n6Te82mo0sT4KyGPXuvi9skHvZDnqbrpss+qx467K0R1SMh0PMUcm7mHfXpCF\n3QUtAwxw6VE6m+sxcW+Vj9lq3MW5rc9uu3BGuYk7qOO9beWok6YBw/jbX8Cs\nDnnqt/0w3jtSqWVnUUw/RJ1uTXjkNC6DufUx2vR1LvsgFlZF5ejQDXkUJFzW\nySD6wPoDimdkNYrK9LPpqqSyGTsvdrtI7YmjU0tVVsrIgxUbHHqpWyJNR2aN\nKgoacZG/bVNmv9l/pSWW3fiKxJE7UE+uqCEBxR+JiHW4HxZD7tWJSvlnaNoh\nbmKymWyD5eRwPRzinoxiw2G/RmQpVoJXH5TuzeqBSzPeD7QxE6g8mF5mwFz9\nEuvgmwKyXLHcTgnjxI+7xcyUeXY4CwrsGWlM/nPtSUcNZYzlCwSsc/62CJB1\nKKOZLgM+sQqzbA/sJAV+eRcdKj3ZmWPpcQa8U0AyEYCkyRU6ek7HWV8krzA6\nwl1np2Wm1euqxWmVzLQqy+dOW8V9kEL8VWI/1kkd9k699m8AP1qrJzfKc/ta\nRizc\r\n=oAU7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOkRR6J/70SzEOl0+X0rLaUN6yIe1xcomYMQ8UycqJaAiEAyi0KvJfsfXQKvgdg7zgmksQVk6+v3hwQ16ZCdCE+ick="}]},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/form-data2_1.0.4_1581986453574_0.9669200871724928"},"_hasShrinkwrap":false}},"readme":"# form-data2\n\nA Streams2-compatible drop-in replacement for the `form-data` module. Through the wrapping done by the underlying `combined-stream2` module, old-style streams are also supported.\n\nTakes a number of streams or Buffers, and turns them into a valid `multipart/form-data` stream.\n\n## License\n\n[WTFPL](http://www.wtfpl.net/txt/copying/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), whichever you prefer. A donation and/or attribution are appreciated, but not required.\n\n## Donate\n\nMy income consists entirely of donations for my projects. If this module is useful to you, consider [making a donation](http://cryto.net/~joepie91/donate.html)!\n\nYou can donate using Bitcoin, PayPal, Gratipay, Flattr, cash-in-mail, SEPA transfers, and pretty much anything else.\n\n## Contributing\n\nPull requests welcome. Please make sure your modifications are in line with the overall code style, and ensure that you're editing the `.coffee` files, not the `.js` files.\n\nBuild tool of choice is `gulp`; simply run `gulp` while developing, and it will watch for changes.\n\nBe aware that by making a pull request, you agree to release your modifications under the licenses stated above.\n\n## Migrating from `form-data`\n\nWhile `form-data2` was designed to be roughly API-compatible with the `form-data` module, there are a few notable differences:\n\n* `form-data2` does __not__ do HTTP requests. It is purely a multipart/form-data encoder. This means you should use a different module for your HTTP requests, such as [`bhttp`](https://www.npmjs.com/package/bhttp), [`request`](https://www.npmjs.com/package/request), or the core `http` module. `bhttp` uses `form-data2` internally - that means you won't have to manually use `form-data2`.\n* The `header` option for the `form.append()` options object is not (yet) implemented. This means that you cannot currently set custom field headers.\n* There is no `form.getLengthSync()` method. Length retrieval is always asynchronous.\n* The `form.getHeaders` method is __always asynchronous__ (whereas in the original `form-data`, it is synchronous). Due to the requirements for obtaining the stream length reliably, there is no synchronous equivalent.\n* A `form-data2` stream is not a real stream. Only the `form.pipe()` method is implemented, other stream methods are unavailable. This may change in the future.\n\n## Usage\n\n```javascript\nvar FormData = require('form-data2');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\n### Getting the HTTP headers\n\n```javascript\nPromise = require(\"bluebird\");\nutil = require(\"util\");\n\nPromise.try(function(){\n\tform.getHeaders();\n}).then(function(headers){\n\tconsole.log(\"Stream headers:\", util.inspect(headers));\n}).catch(function(err){\n\tconsole.log(\"Something went wrong!\");\n});\n```\n\n... or using nodebacks:\n\n```javascript\nform.getHeaders(function(err, headers){\n\tif(err) {\n\t\tconsole.log(\"Something went wrong!\");\n\t} else {\n\t\tconsole.log(\"Stream headers:\", util.inspect(headers));\n\t}\n});\n```\n\n## API\n\nNote that this is __not__ a real stream, and does therefore not expose the regular `stream.Readable` properties. The `pipe` method will simply pipe the underlying `combined-stream2` stream into the specified target. If you want to access the stream directly for some reason, use `form._stream`.\n\n### append(name, source, [options])\n\nAdds a new data source to the multipart/form-data stream.\n\nThis module will *not* automatically handle arrays for you - if you need to send an array, you will need to call this method for each element individually, using the same `[]`-suffixed field name for each element.\n\n* __name__: The name of the form field.\n* __source__: The data source to add. This can be a stream, a Buffer, or a UTF-8 string.\n* __options__: *Optional.* Additional options for the stream.\n\t* __contentLength__: The total length of the stream. Useful if your stream is of a type that [`stream-length`](https://www.npmjs.com/package/stream-length) can't automatically determine the length of. Also available under the alias `knownLength`, for backwards compatibility reasons.\n\t* __contentType__: The MIME type of the source. It's recommended to *always* specify this manually; however, if it's not supplied, `form-data2` will attempt to determine it for you where possible.\n\t* __filename__: The filename of the source, if it is a file or should be represented as such. It's recommended to *always* specify this manually (if the source is a file of some sort); however, if it's not supplied, `form-data2` will attempt to determine it for you where possible.\n\n### getHeaders([callback])\n\nAsynchronously returns the HTTP request headers that you will need to successfully transmit this stream, as an object.\n\nAll object keys are lower-case. To use the headers, simply merge them into the headers object for your request.\n\nIf you specify a `callback`, it will be treated as a nodeback. If you do *not* specify a `callback`, a Promise will be returned.\n\n### pipe(target)\n\nPipes the `multipart/form-data` stream into the `target` stream.\n\n### done()\n\n__You probably don't need to call this.__\n\nCalling this method will append the multipart/form-data footer to the stream. It is called automatically when you `pipe` the stream into something else.\n\n### getBoundary()\n\n__You probably don't need to call this.__\n\nReturns the form boundary used in the `multipart/form-data` stream.\n\n### getLength([callback])\n\n__You probably don't need to call this.__\n\nAsynchronously returns the total length of the stream in bytes.\n\nIf you specify a `callback`, it will be treated as a nodeback. If you do *not* specify a `callback`, a Promise will be returned.\n\n## Changelog\n\n### v1.0.4 (February 18, 2020)\n\n- Added this changelog to the README\n- Removed Lodash, resolving the audit warnings\n- Removed CoffeeScript\n- Removed Gulp\n\n### v1.0.3 (March 17, 2015)\n\n- Added documentation about asynchronicity of `form.getHeaders`\n\n### v1.0.2 (January 23, 2015)\n\n- Fixed packaging mistake (again)\n\n### v1.0.1 (January 23, 2015)\n\n- Fixed packaging mistake\n\n### v1.0.0 (January 22, 2015)\n\nInitial release.\n","maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"time":{"modified":"2022-06-18T03:00:47.576Z","created":"2015-01-22T16:18:59.483Z","1.0.0":"2015-01-22T16:18:59.483Z","1.0.1":"2015-01-23T17:28:50.812Z","1.0.2":"2015-01-23T17:30:03.625Z","1.0.3":"2015-03-17T16:05:06.336Z","1.0.4":"2020-02-18T00:40:53.705Z"},"keywords":["form-data","multipart","http","stream"],"repository":{"type":"git","url":"http://git.cryto.net/joepie91/node-form-data2.git"},"author":{"name":"Sven Slootweg"},"license":"WTFPL","readmeFilename":"README.md"}