99 lines
10 KiB
JSON
99 lines
10 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "multiparty@3.3.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "multiparty",
|
||
|
"name": "multiparty",
|
||
|
"rawSpec": "3.3.2",
|
||
|
"spec": "3.3.2",
|
||
|
"type": "version"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/connect"
|
||
|
]
|
||
|
],
|
||
|
"_from": "multiparty@3.3.2",
|
||
|
"_id": "multiparty@3.3.2",
|
||
|
"_inCache": true,
|
||
|
"_location": "/multiparty",
|
||
|
"_npmUser": {
|
||
|
"name": "dougwilson",
|
||
|
"email": "doug@somethingdoug.com"
|
||
|
},
|
||
|
"_npmVersion": "1.4.21",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "multiparty@3.3.2",
|
||
|
"scope": null,
|
||
|
"escapedName": "multiparty",
|
||
|
"name": "multiparty",
|
||
|
"rawSpec": "3.3.2",
|
||
|
"spec": "3.3.2",
|
||
|
"type": "version"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/connect"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz",
|
||
|
"_shasum": "35de6804dc19643e5249f3d3e3bdc6c8ce301d3f",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "multiparty@3.3.2",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/connect",
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/andrewrk/node-multiparty/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"readable-stream": "~1.1.9",
|
||
|
"stream-counter": "~0.2.0"
|
||
|
},
|
||
|
"description": "multipart/form-data parser which supports streaming",
|
||
|
"devDependencies": {
|
||
|
"findit": "~2.0.0",
|
||
|
"mkdirp": "~0.5.0",
|
||
|
"pend": "~1.1.1",
|
||
|
"rimraf": "~2.2.8",
|
||
|
"superagent": "~0.18.0"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "35de6804dc19643e5249f3d3e3bdc6c8ce301d3f",
|
||
|
"tarball": "https://registry.npmjs.org/multiparty/-/multiparty-3.3.2.tgz"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">=0.8.0"
|
||
|
},
|
||
|
"gitHead": "96e1b70c7a9844689f85ba56e1c4437240ae58ea",
|
||
|
"homepage": "https://github.com/andrewrk/node-multiparty#readme",
|
||
|
"keywords": [
|
||
|
"file",
|
||
|
"upload",
|
||
|
"formidable",
|
||
|
"stream",
|
||
|
"s3"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "superjoe",
|
||
|
"email": "superjoe30@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "dougwilson",
|
||
|
"email": "doug@somethingdoug.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "multiparty",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# multiparty [![Build Status](https://travis-ci.org/andrewrk/node-multiparty.svg?branch=master)](https://travis-ci.org/andrewrk/node-multiparty) [![NPM version](https://badge.fury.io/js/multiparty.svg)](http://badge.fury.io/js/multiparty)\n\nParse http requests with content-type `multipart/form-data`, also known as file uploads.\n\nSee also [busboy](https://github.com/mscdex/busboy) - a\n[faster](https://github.com/mscdex/dicer/wiki/Benchmarks) alternative\nwhich may be worth looking into.\n\n### Why the fork?\n\n * This module uses the Node.js v0.10 streams properly, *even in Node.js v0.8*\n * It will not create a temp file for you unless you want it to.\n * Counts bytes and does math to help you figure out the `Content-Length` of\n each part.\n * You can easily stream uploads to s3 with\n [knox](https://github.com/LearnBoost/knox), for [example](examples/s3.js).\n * Less bugs. This code is simpler, has all deprecated functionality removed,\n has cleaner tests, and does not try to do anything beyond multipart stream\n parsing.\n\n## Installation\n\n```\nnpm install multiparty\n```\n\n## Usage\n\n * See [examples](examples).\n\nParse an incoming `multipart/form-data` request.\n\n```js\nvar multiparty = require('multiparty')\n , http = require('http')\n , util = require('util')\n\nhttp.createServer(function(req, res) {\n if (req.url === '/upload' && req.method === 'POST') {\n // parse a file upload\n var form = new multiparty.Form();\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### multiparty.Form\n```js\nvar form = new multiparty.Form(options)\n```\nCreates a new form. Options:\n\n * `encoding` - sets encoding for the incoming form fields. Defaults to `utf8`.\n * `maxFieldsSize` - Limits the amount of memory a field (not a file) can\n allocate in bytes. If this value is exceeded, an `error` event is emitted.\n The default size is 2MB.\n * `maxFields` - Limits the number of fields that will be parsed before\n emitting an `error` event. A file counts as a field in this case.\n Defaults to 1000.\n * `maxFilesSize` - Only relevant when `autoFiles` is `true`. Limits the\n total bytes accepted for all files combined. If this value is exceeded,\n an `error` event is emitted. The default is `Infinity`.\n * `autoFields` - Enables `field` events. This is automatically set to `true`\n if you add a `field` listener.\n * `autoFiles` - Enables `file` events. This is automatically set to `true`\n if you add a `file` listener.\n * `uploadDir` - Only relevant when `autoFiles` is `true`. The directory for\n placing file uploads in. You can move them later using `fs.rename()`.\n Defaults to `os.tmpDir()`.\n * `hash` - Only relevant when `autoFiles` is `true`. If you want checksums\n calculated for incoming files, set this to either `sha1` or `md5`.\n Defaults to off.\n\n#### form.parse(request, [cb])\n\nParses an incoming node.js `request` containing form data.This will cause\n`form` to emit events based off the incoming request.\n\n```js\nvar count = 0;\nvar form = new multiparty.Form();\n\n// Errors may be emitted\nform.on('error', function(err) {\n console.log('Error parsing form: ' + err.stack);\n});\n\n// Parts are emitted when parsing the form\nform.on('part', function(part) {\n // You *must* act on the part by reading it\n // NOTE: if you want to ignore it, just call \"part.resume()\"\n\n if (part.filename === null) {\n // filename is \"null\" when this is a field and not
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+ssh://git@github.com/andrewrk/node-multiparty.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"test": "ulimit -n 500 && node test/test.js"
|
||
|
},
|
||
|
"version": "3.3.2"
|
||
|
}
|