Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-body

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-body - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

28

index.js

@@ -24,3 +24,3 @@ /**

module.exports = requestbody;
module.exports = requestbody;

@@ -63,7 +63,7 @@ /**

};
};
}
/**
* Donable formidable
*
*
* @param {Stream} ctx

@@ -77,7 +77,19 @@ * @param {Object} opts

var form = new forms.IncomingForm(opts)
form.parse(ctx.req, function(err, fields, files) {
if (err) return done(err)
done(null, {fields: fields, files: files})
})
}
var fields = {};
var files = {};
form
.on('end', function() {
done(null, {fields: fields, files: files});
})
.on('error', function(err) {
done(err);
})
.on('field', function(field, value) {
fields[field] = value;
})
.on('file', function(field, file) {
files[field] = file;
});
form.parse(ctx.req);
};
}
{
"name": "koa-body",
"version": "0.3.0",
"version": "0.4.0",
"description": "A koa body parser middleware. Support multipart, urlencoded and json request bodies.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc