Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "lightserve", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Lightweight NodeJS web server", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -125,2 +125,16 @@ # LightServe | ||
#### `body: object` | ||
The `body` object contains all the request body (for all requests but multipart ones where it is undefined). | ||
#### `multipart: object` | ||
The `multipart` object contains the request multipart body. | ||
Each key of the object is a field name, each value is an object with a `type` property which value can be `field` or `file`. | ||
**For fields** : The value is the string representation of what has been sent. | ||
**For files** : The value is a buffer containing the file data. | ||
#### `context: object` | ||
@@ -127,0 +141,0 @@ |
@@ -5,5 +5,9 @@ const multiparty = require('multiparty') | ||
return new Promise((resolve, reject) => { | ||
let contents = '' | ||
let contents = null | ||
part.on('data', (chunk) => { | ||
contents += chunk.toString() | ||
if (!contents) { | ||
contents = chunk | ||
} else { | ||
contents = Buffer.concat([contents, chunk]) | ||
} | ||
}).on('end', () => { | ||
@@ -10,0 +14,0 @@ resolve(contents) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27000
846
201