From 20d880f81c8d35bc5399dce00904728cfcb788b2 Mon Sep 17 00:00:00 2001 From: Abir Sheikh Date: Thu, 7 Jul 2022 08:25:41 +0600 Subject: [PATCH] UPDATED: README.md --- README.md | 24 ++++++++++++++++++++---- package.json | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d6709c..d2dbb7a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,22 @@ async function requestHandler(req, res){ // other things } ``` +When we try to log body, we will get an object similar to this + +```javascript +{ + fields:{ + name: , + value: , + info: + }, + files:{ + name: , + content: , + info: + } +} +``` Notice, we pass in `req` as the first argument. The `req` we pass in must be an instance of `IncomingMessage` from node `http` module or it can be an instance of `Request` constructor. @@ -38,10 +54,10 @@ As, parter uses `busboy`, this is the same configuration object you would pass in busboy. But, you can, of course pass additional properties. ```javascript -options.errorOnMoreFields = Boolean -options.errorOnMoreFiles = Boolean -options.errorOnMoreParts = Boolean -options.errorOnLargerFileSize = Boolean +options.errorOnMoreFields = +options.errorOnMoreFiles = +options.errorOnMoreParts = +options.errorOnLargerFileSize = ``` - `errorOnMoreFields` diff --git a/package.json b/package.json index 447cbff..c66f0c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@obboy/parter", - "version": "1.0.0", + "version": "1.0.1", "description": "Promise based multipart parser", "main": "index.js", "repository": {