{"_id":"formidable-serverless","_rev":"5-e2109cfd4f453284ea1e9c3020cfc12f","name":"formidable-serverless","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"formidable-serverless","version":"1.0.0","description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","license":"MIT","dependencies":{"formidable":"^1.2.1"},"directories":{"lib":"./lib"},"main":"./lib/index","scripts":{},"keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"homepage":"https://github.com/Amit-A/formidable-serverless","author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"devDependencies":{"eslint":"^5.15.0"},"gitHead":"626437b7aadb220bbb238a81e13e1b8eac9b359f","_id":"formidable-serverless@1.0.0","_nodeVersion":"11.2.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-hGGOzdJsmHUmkX/bmt1ZgJrlGtlEb6hEwhiaPFyzggd7L5iWQrYY9IzH4Hvq/vbm60elXjavftXLnXwnWoXkLg==","shasum":"90fe008e5f68efaf1259601b4faebc2c1f3bdd76","tarball":"https://registry.npmjs.org/formidable-serverless/-/formidable-serverless-1.0.0.tgz","fileCount":6,"unpackedSize":12095,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce1w7CRA9TVsSAnZWagAAgJ8QAJZy3RELpnfeB10pGsTE\nUZ60cc79ctwhpBka8FGDBlrf24mMx3BA0n/u+kj7vC+ZijDrWZoHNJf2jO1/\n6W/js1zb88E49k0IZ9UiNF3K90TfgHCmiMlt6TmrABIyLSmCDqZheYWN/+QR\n1EgVAayCI2pVzRT72jUsmCZOtHrM9IgFN5tBIUcBTAnrvTU2+KSQxOa1+SLz\n6+tg65uoTPCMLTJ3i86Qftc5X3Bh7ROUvRg74PEMO2mMuLpwGUL/ZzeXddFk\nmuK+5p/aDUG0HzOk8ASrrwVQ0SSAkOVp8hzg+Pt89eMYawOyyyU+Dfy568iM\nYHPbrlzRPCVsyJCIk1ataGows33KAmYZvukdt6puFNhgt6TRdXPeDi59UVCY\nPjsHT51j1gTWiIN6uB5D3qvWjpaY3UD2kQbi5YvyGe3Yfgmhu7ri8CG2dtzy\ndzgk3JCtspvh1hoVNhRkaj2WUCimjVOmMs40P2CYH6j72zMOAF3Yib5elRyq\nwacKVnxLeshcyzJ/n3kquOWxa/X9tvid/d3qRC6FMich7ivE98srUy0nlRI+\noBM2AMnHLBwn0/5KOApKLaGBAaYvNEPg5jZsKPslBdiwqcuZGTxJ8xMZg9e7\nfNwe2t6XWrCBFByWYKcILhdeXeuYdBuM6SM4zCW4jUuLPMfZxfKooPrlYPc4\nDPIi\r\n=txFS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6mdQzQ2x5ZC6XhTlolVMS8Tf/Nf4Uyy81x4XFUGJ6lAiBh89EGA3DtH5sC065dbXFmqSRa60LdIXHeN1++MUaLyQ=="}]},"maintainers":[{"name":"amit-a","email":"kumar.amit@live.ca"}],"_npmUser":{"name":"amit-a","email":"kumar.amit@live.ca"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formidable-serverless_1.0.0_1551588410557_0.2180676487982267"},"_hasShrinkwrap":false},"1.0.1":{"name":"formidable-serverless","version":"1.0.1","description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","license":"MIT","dependencies":{"formidable":"^1.2.1"},"directories":{"lib":"./lib"},"main":"./lib/index","scripts":{},"keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"homepage":"https://github.com/Amit-A/formidable-serverless","author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"devDependencies":{"eslint":"^5.15.0"},"gitHead":"d770ecc68f0dac0e5c0b3dc5a0fce4a3e6c9f462","_id":"formidable-serverless@1.0.1","_nodeVersion":"11.2.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-kjnf31IB39j+OdPDC/hxRvz8exOgLmal65dgUoHk8H4JbH1wtvx3cxxqRH2RB0FK4OVR65qqPtTrTHNPsO0d5w==","shasum":"4a9c39de44630f9674bb26e3eb97a0212b675c29","tarball":"https://registry.npmjs.org/formidable-serverless/-/formidable-serverless-1.0.1.tgz","fileCount":7,"unpackedSize":13291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAFmxCRA9TVsSAnZWagAAtHsP/jRNyx4WPM82dwc/1HcV\nJXV5HS6WzlMT3VgDXYjM75/bhHc9npMOYG+L0mhGMsDR5wpQOQGbuP4mzXuX\nricu5qQyGqEL6jLH3DCEUobVGStMJ/La5CE5gRkvXJX76MFzup10b3uOLIW1\nQMmrIHIalbGJA8irmenXPb41kD/xZptnQnkhskCETlEsUYZETXm4JiVQwgjb\nsn3ZH6TRCq2/7TjjMbzGPPjtuOpj36fwNE2FHSjNkSX1NqWQB0nBbYClXtM9\nQyLGf8hjspAV8XF6AHg7DXoPTAGg2Pw2KNDkoj/zn9qlbJn9/gOZgRAGbhgx\nJKnYiJq0jnOKG+nJ0M9bytgE2SvP1HjiCZDwUp6tkZZ/E7FTmYet1lBInG5f\nD5sihY/MB8bTLTmvHdp1qmxf5ysy8COdssq3OjGZbhuuGgtk02HNHBkUNnkL\npUIugF5GtUFTCYuK+BrAWfQULus46DFKvs8LjTq490TTAZH6fM0vzmV8fsqJ\nL1bmi1VGGdYO/sBqOEhO+Ij05x+98VifL8xSr5/AKMwCF59anUtw37MYEKbo\nAy83wI10qVkH/TiN3BIdNGaC9eFlVbSPFFCWyXqJt375MEUs5SgR++LNCsib\n+49Vn3z6Unqz7U3CwgWn/xPSqMNmHiSBveaOhWhnkGVUzv6d2v+TPTtiFrIq\n0Vql\r\n=r5q+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDnEdNAefcLYIEL0LYjsxWf1ri2iXXymZM6QhlPTRLJgIgImI1CbeaWH8ts1COug7y3Jp0EUsx2pAw4qadSFljIPs="}]},"maintainers":[{"name":"amit-a","email":"kumar.amit@live.ca"}],"_npmUser":{"name":"amit-a","email":"kumar.amit@live.ca"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formidable-serverless_1.0.1_1560304048335_0.5887143710734493"},"_hasShrinkwrap":false},"1.0.2":{"name":"formidable-serverless","version":"1.0.2","description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","license":"MIT","dependencies":{"formidable":"^1.2.1"},"directories":{"lib":"./lib"},"main":"./lib/index","scripts":{},"keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"homepage":"https://github.com/Amit-A/formidable-serverless","author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"devDependencies":{"eslint":"^5.15.0"},"gitHead":"98839030bda28416850840626f43a63720c21260","_id":"formidable-serverless@1.0.2","_nodeVersion":"11.2.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-T/YTciz5PL09GOEYOt3K/1ulsz2J6zFEVxYocS0bHgojAW4Pl+NrSwh6imK8p7tKskB5llm6cF+9UTa+b6xwVQ==","shasum":"5626e3b00b3f2f04cfb0b504ecfd7d2dba38667e","tarball":"https://registry.npmjs.org/formidable-serverless/-/formidable-serverless-1.0.2.tgz","fileCount":7,"unpackedSize":13291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdRK1lCRA9TVsSAnZWagAAdUsP/1+fy4SAUjq/+ZJDU8WO\njP7R9kj40DLQLlWK+2E1H9stX5ZcEIBkvwh5u5SjobKNHB9v45GVvqMtr77h\n03HbtYAGTZ6V6JgqUyEVu+q93LPBtqVFVRJ3qrTKDHHJwE4+OIPVUwUnBRCW\n5mmxK/H0Jmf8xMy3dTDpM9eE83+Xbz6zWt+4XdtFykYhLAwYfVtQQP0abQDK\nwsDd7IGTfuVlfgbbzsL67EzVunaNS0mx1xa8LmECv/CFDj21v08smxNun0GH\nkK5btLdGw3xU4/V9fCvu3Qigm3xy996gL/pLKpOjN48749n2QDehSEh183x4\n97SJbqL8BaZrLdUs5yXk0CfRWIlNPQLcpIVoka/7sSsMYVZ72//ZkxqSsE+y\ndVIPvraB8/gebk0TagdqGgAWpLaqRGqZ6Y/SG/WqDbvq6+D0AMFW5/1QJPSy\n5WXtuhjZoYhUEG4xpA/id4qIh6ML7xjEQvSag5yIj9QPD0f+BcwvXEwkvU47\ngbnhrWzDSvs3qY3/AgmTw+TPh3/j/BAhTSVgtyvzRxQem2BQ7dTouJVuwLDU\nZ9YXZYVw/Rfw4FUPeDf1MN7tSha2bMwfTPcw+cj3h/uopFK2HO3cAAxVgSyw\nn8S0AoMghim5n4fkvSkNmypXUDTVlxwIHTxbkWm3+yRNP1nh8EnEn7wTDhxO\ntzFI\r\n=BVXb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXdt6vSD49qF99RJpf03TWe6XWX1Ibyn3RDOiMkHvvAQIgakjBf1iYq2SygJlFR61qIrE2BCSn/xvCqCil0GAoaNI="}]},"maintainers":[{"name":"amit-a","email":"kumar.amit@live.ca"}],"_npmUser":{"name":"amit-a","email":"kumar.amit@live.ca"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formidable-serverless_1.0.2_1564781924823_0.2606239761885416"},"_hasShrinkwrap":false},"1.0.3":{"name":"formidable-serverless","version":"1.0.3","description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","license":"MIT","dependencies":{"formidable":"^1.2.1"},"directories":{"lib":"./lib"},"main":"./lib/index","scripts":{},"keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"homepage":"https://github.com/Amit-A/formidable-serverless","author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"devDependencies":{"eslint":"^5.15.0"},"gitHead":"5cbf6db85a54a018fb3e147dee9b035b65383075","_id":"formidable-serverless@1.0.3","_nodeVersion":"12.12.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-BT47bmGBk3V2kQwNPBvM5SY1Ypc08CnFinBOp05gVrH+4g7ZlxYX6kQtC8wuLjH+Qcj0Re10PY2VxBlpNIWGGQ==","shasum":"5023c04b394bddcf4f6d27bfbe1c7d89dd1e5368","tarball":"https://registry.npmjs.org/formidable-serverless/-/formidable-serverless-1.0.3.tgz","fileCount":7,"unpackedSize":13559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/05QCRA9TVsSAnZWagAA+HwQAJouKXNMI3w0UNhwL1bS\nGqHvI9zl/Z8Kg4qzlfOyxWsUO/RqOie6bT9UPT/JPiAOY66d5MWlJd5A8wEI\nnKzybzjOOIsqYgzomMDqJd5COojDlU+pCd5Nm8W8So68Shm529X3ymxwVzMl\nW1Zp9HC1V4hshZZrmGO0ZcynZf4msZTRhNLdZe33UBiisKjte2b3MP9y73C5\n3KcDVEFpMuggD4foFIgvgGLHvY348o+8vPhkxvG0VoQKAyxiu+lQc0zfrvJA\n/AY8ACieuXqYjJK5+4aTfmA+/Zi7yQ42uePVslnpIgJBxHyuZdrtK93tQEIi\nSF0Xz4yP1KBBauSMVX17PVpXYJTYds38yIlZhfrLWAShj3LIRQ4wzqxL6dlI\n9t9376l3XNdYbHT/c8hDdqsZFNv7TtRx6N7pHfyiPL//7jBIeJwCSkAuuPGC\nh0PFSKUeulFGeZsyHpLQGpPLnPZCkEsJ79oJH6tVQQZgubgXFHwdn3xqwpMN\nHOVMFJjawj2EIGd3uKGeIAIzhbDn5x8/OtGEE3WxE4C7pfuFWFB5T83JYpez\nh0Te6jQU169A9ApOyvvGstWgC3Ie6Y7UZGfoRRFy0kdHTZIhy9eI41e0Z9W8\nubUnOpB2y62GmkmgBNugZ7l2rVnluQ80ANWDBc8Z5Tm2hgvXbInKCdLZe3xY\nMiQM\r\n=vI5F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJKPAoWGXjN4ZjkVXnwnwzfsHJNZV+8fOxc8Yw3UL+qwIhAImbtmbeiWAiJ4VKv8YeaS1VZQAJyPcOGRdzuxDT8ZOU"}]},"maintainers":[{"name":"amit-a","email":"kumar.amit@live.ca"}],"_npmUser":{"name":"amit-a","email":"kumar.amit@live.ca"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formidable-serverless_1.0.3_1577012815984_0.24460282189493476"},"_hasShrinkwrap":false},"1.1.1":{"name":"formidable-serverless","version":"1.1.1","description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","license":"MIT","dependencies":{"formidable":"^1.2.2"},"directories":{"lib":"./lib"},"main":"./lib/index","scripts":{},"keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"homepage":"https://github.com/Amit-A/formidable-serverless","author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"devDependencies":{"eslint":"^7.17.0"},"gitHead":"25662e941e4636bfb12eeaccca29a51befbe1595","_id":"formidable-serverless@1.1.1","_nodeVersion":"14.2.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-IUVI2m7d46YnWRZ9RG+wvmLoX0tTrk9P6oFc53QVjM9k0XhqzeyjwDi05PLvpGNKbyLvB3gfsAc+Lk6efM3FGQ==","shasum":"2b668d6e92d5222794a48ed485bcf7cd47efebfb","tarball":"https://registry.npmjs.org/formidable-serverless/-/formidable-serverless-1.1.1.tgz","fileCount":7,"unpackedSize":13649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf83syCRA9TVsSAnZWagAACxEP/iBGhapM8mFuxzIuQIKG\nGpxulcLBy93NlJ1BdimKCuc7ZYn43WEQR4AUBRBEw4EIQMkt45uyfJYVWQGj\nrZded/ybHUmr5EQcuf+sXTbVJAXSfzyVE5fq5t15ktjp5MLC520D+IaPJbRc\nZNcr4l9cYFYrstDM03iJwoNd4ZXBETgjW9zEvFz6oRSzxmZ3cguOSaI5opB/\nRYWkBI1dntQ8i2FoTzVlRkfsjTdjnQj6hEuTyEKKO2ehrKoN42OdqG4Jxh8T\nAkl2Y84U2GkpQzjllFL35LCAgUWtcpR//dMlsBYKqW+PIlA2a8dNr+o6QNtp\na5QxP6BqaBxfpiGm43+jQEpAiaTs5fCahSBaOKlOU8PjZfVYz3EFBJKVuSnw\nfFYzLP7jfocVLLqliAJvCg44/mmGG/jREIWBn43evtanvuluZbNV1ug44Gnq\nr7yPE/BtWzfbJ9+hpZATnIkSOOHhC0Sna4JUtvguxiErpUqIrtSQCLvvjy6Q\nigl8pb23jg78YWWs12VtTMqSw41L7W6I9foc77Blg6/83pPJvnBv8Ee9tAIm\nP1MlKjAqH0/HKN7EwsfZJFBvqxRPCB9/IF6fDSZgTHLqd5rGu+Gktz5RGDO1\noq1Q0tMdH9WPkzvrsD3Rwm7vG/gy6dVKylqZ+LwPYBASdI1LF6x87HkThXaC\nJTCo\r\n=vRH1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzrRaGlScV3wlNq0Epqulwy0XOP9fyV1EdYLtldI/TZAiEApGsys+w9h90vRa60VIE+5StQlt/He6QrXcxg6/aWDq0="}]},"_npmUser":{"name":"amit-a","email":"amit@testmail.app"},"maintainers":[{"name":"amit-a","email":"amit@testmail.app"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formidable-serverless_1.1.1_1609792306048_0.22293724648860125"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-03T04:46:50.557Z","1.0.0":"2019-03-03T04:46:50.849Z","modified":"2022-05-02T19:47:23.911Z","1.0.1":"2019-06-12T01:47:28.438Z","1.0.2":"2019-08-02T21:38:45.033Z","1.0.3":"2019-12-22T11:06:56.099Z","1.1.1":"2021-01-04T20:31:46.189Z"},"maintainers":[{"name":"amit-a","email":"amit@testmail.app"}],"description":"Enables use of formidable (node.js module for parsing form data, especially file uploads) in serverless environments.","homepage":"https://github.com/Amit-A/formidable-serverless","keywords":["formidable","node-formidable","serverless","firebase","cloudfunctions","lambda"],"repository":{"type":"git","url":"git+https://github.com/Amit-A/formidable-serverless.git"},"author":{"name":"Amit A.Kumar","email":"kumar.amit@live.ca"},"bugs":{"url":"https://github.com/Amit-A/formidable-serverless/issues"},"license":"MIT","readme":"# formidable-serverless\n\n[![npm version](https://badge.fury.io/js/formidable-serverless.svg)](https://badge.fury.io/js/formidable-serverless)\n\n## Purpose\n\nThis module is a variant of [formidable](https://www.npmjs.com/package/formidable) with tweaks to enable use in serverless environments (AWS Lambda, Firebase/Google Cloud Functions, etc.) and environments where the request has already been processed (e.g. by bodyparser).\n\nThe functionality and usage/API are identical to [formidable](https://www.npmjs.com/package/formidable) (documentation cloned below).\n\n## Status\n\nSponsored and maintained by the folks at [testmail.app](https://testmail.app)\n\n## How it works\n\nThe preprocessing by bodyparsers built-in to serverless environments breaks formidable's parse handlers and causes \"Request Aborted\" errors. This module imports formidable as a dependency and modifies the handlers to support preprocessed request bodies.\n\nThis module can also be used in non-serverless environments (usage and API are identical), but it may be a version or two behind. This package is focused on serverless - if you have issues with formidable itself, please open them in the formidable repo.\n\n## Formidable\n\nA Node.js module for parsing form data, especially file uploads.\n\nFormidable was developed for [Transloadit](http://transloadit.com/), a service focused on uploading and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from a large variety of clients and is considered production-ready.\n\n## Features\n\n* Fast (~500mb/sec), non-buffering multipart parser\n* Automatically writing file uploads to disk\n* Low memory footprint\n* Graceful error handling\n* Very high test coverage\n\n## Installation\n\n```sh\nnpm install --save formidable-serverless\n```\n\nThis is a low-level package, and if you're using a high-level framework it may already be included. However, [Express v4](http://expressjs.com) does not include any multipart handling, nor does [body-parser](https://github.com/expressjs/body-parser).\n\n## Example\n\nParse an incoming file upload.\n\n```javascript\nconst formidable = require('formidable-serverless');\nconst http = require('http');\nconst util = require('util');\n\nhttp.createServer(function(req, res) {\n  if (req.url == '/upload' && req.method.toLowerCase() == 'post') {\n    // parse a file upload\n    const form = new formidable.IncomingForm();\n\n    form.parse(req, function(err, fields, files) {\n      res.writeHead(200, {'content-type': 'text/plain'});\n      res.write('received upload:\\n\\n');\n      res.end(util.inspect({fields: fields, files: files}));\n    });\n\n    return;\n  }\n\n  // show a file upload form\n  res.writeHead(200, {'content-type': 'text/html'});\n  res.end(\n    '<form action=\"/upload\" enctype=\"multipart/form-data\" method=\"post\">'+\n    '<input type=\"text\" name=\"title\"><br>'+\n    '<input type=\"file\" name=\"upload\" multiple=\"multiple\"><br>'+\n    '<input type=\"submit\" value=\"Upload\">'+\n    '</form>'\n  );\n}).listen(8080);\n```\n\n## API\n\n### Formidable.IncomingForm\n\n```javascript\nvar form = new formidable.IncomingForm()\n```\n\nCreates a new incoming form.\n\n```javascript\nform.encoding = 'utf-8';\n```\n\nSets encoding for incoming form fields.\n\n```javascript\nform.uploadDir = \"/my/dir\";\n```\n\nSets the directory for placing file uploads in. You can move them later on using `fs.rename()`. The default is `os.tmpdir()`.\n\n```javascript\nform.keepExtensions = false;\n```\n\nIf you want the files written to `form.uploadDir` to include the extensions of the original files, set this property to `true`.\n\n```javascript\nform.type\n```\n\nEither 'multipart' or 'urlencoded' depending on the incoming request.\n\n```javascript\nform.maxFieldsSize = 20 * 1024 * 1024;\n```\n\nLimits the amount of memory all fields together (except files) can allocate in bytes. If this value is exceeded, an `'error'` event is emitted. The default size is 20MB.\n\n```javascript\nform.maxFileSize = 200 * 1024 * 1024;\n```\n\nLimits the size of uploaded file. If this value is exceeded, an `'error'` event is emitted. The default size is 200MB.\n\n```javascript\nform.maxFields = 1000;\n```\n\nLimits the number of fields that the querystring parser will decode. Defaults to 1000 (0 for unlimited).\n\n```javascript\nform.hash = false;\n```\n\nIf you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`.\n\n```javascript\nform.multiples = false;\n```\n\nIf this option is enabled, when you call `form.parse`, the `files` argument will contain arrays of files for inputs which submit multiple files using the HTML5 `multiple` attribute.\n\n```javascript\nform.bytesReceived\n```\n\nThe amount of bytes received for this form so far.\n\n```javascript\nform.bytesExpected\n```\n\nThe expected number of bytes in this form.\n\n```javascript\nform.parse(request, [cb]);\n```\n\nParses an incoming node.js `request` containing form data. If `cb` is provided, all fields and files are collected and passed to the callback:\n\n```javascript\nform.parse(req, function(err, fields, files) {\n  // ...\n});\n\nform.onPart(part);\n```\n\nYou may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events  processing which would occur otherwise, making you fully responsible for handling the processing.\n\n```javascript\nform.onPart = function(part) {\n  part.addListener('data', function() {\n    // ...\n  });\n}\n```\n\nIf you want to use formidable to only handle certain parts for you, you can do so:\n\n```javascript\nform.onPart = function(part) {\n  if (!part.filename) {\n    // let formidable handle all non-file parts\n    form.handlePart(part);\n  }\n}\n```\n\nCheck the code in this method for further inspiration.\n\n### Formidable.File\n\n```javascript\nfile.size = 0\n```\n\nThe size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.\n\n```javascript\nfile.path = null\n```\n\nThe path this file is being written to. You can modify this in the `'fileBegin'` event in case you are unhappy with the way formidable generates a temporary path for your files.\n\n```javascript\nfile.name = null\n```\n\nThe name this file had according to the uploading client.\n\n```javascript\nfile.type = null\n```\n\nThe mime type of this file, according to the uploading client.\n\n```javascript\nfile.lastModifiedDate = null\n```\n\nA date object (or `null`) containing the time this file was last written to. Mostly here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).\n\n```javascript\nfile.hash = null\n```\n\nIf hash calculation was set, you can read the hex digest out of this var.\n\n#### Formidable.File#toJSON()\n\nThis method returns a JSON-representation of the file, allowing you to `JSON.stringify()` the file which is useful for logging and responding to requests.\n\n### Events\n\n#### 'progress'\n\nEmitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.\n\n```javascript\nform.on('progress', function(bytesReceived, bytesExpected) {\n});\n```\n\n#### 'field'\n\nEmitted whenever a field / value pair has been received.\n\n```javascript\nform.on('field', function(name, value) {\n});\n```\n\n#### 'fileBegin'\n\nEmitted whenever a new file is detected in the upload stream. Use this event if you want to stream the file to somewhere else while buffering the upload on the file system.\n\n```javascript\nform.on('fileBegin', function(name, file) {\n});\n```\n\n#### 'file'\n\nEmitted whenever a field / file pair has been received. `file` is an instance of `File`.\n\n```javascript\nform.on('file', function(name, file) {\n});\n```\n\n#### 'error'\n\nEmitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.\n\n```javascript\nform.on('error', function(err) {\n});\n```\n\n#### 'aborted'\n\nEmitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. After this event is emitted, an `error` event will follow. In the future there will be a separate 'timeout' event (needs a change in the node core).\n\n```javascript\nform.on('aborted', function() {\n});\n```\n\n##### 'end'\n\n```javascript\nform.on('end', function() {\n});\n```\n\nEmitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.\n\n## License\n\nFormidable and formidable-serverless are licensed under the MIT license.\n","readmeFilename":"README.md"}