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

then-busboy

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-busboy - npm Package Compare versions

Comparing version 2.0.0-beta.9 to 2.0.0-beta.10

24

lib/listener/onFile.js

@@ -7,6 +7,4 @@ "use strict";

var _cloneableReadable = require("cloneable-readable");
var _stream = require("stream");
var _cloneableReadable2 = _interopRequireDefault(_cloneableReadable);
var _File = require("../File");

@@ -26,13 +24,17 @@

// We need to clone file Readable stream before creating a File instance.
const contents = (0, _cloneableReadable2.default)(stream);
const contents = new _stream.Readable({
read() {/* noop */}
});
const file = new _File2.default({ filename, contents, enc, mime });
const onData = ch => contents.push(ch);
// Busboy will not fire "finish" event because of we're don't read data from
// a file stream. So, here we just fire "end" manually to prevent
// an inifinite Promise pending.
stream.emit("end");
const onEnd = () => {
contents.push(null);
cb(null, [path, file]);
const file = new _File2.default({ filename, contents, enc, mime });
cb(null, [path, file]);
};
stream.on("data", onData).on("end", onEnd);
} catch (err) {

@@ -39,0 +41,0 @@ return cb(err);

{
"name": "then-busboy",
"version": "2.0.0-beta.9",
"version": "2.0.0-beta.10",
"description": "Promise-based wrapper around Busboy. Process multipart/form-data content and returns it as a single object.",

@@ -52,3 +52,2 @@ "repository": "octet-stream/then-busboy",

"busboy": "0.2.14",
"cloneable-readable": "1.0.0",
"lodash.isplainobject": "4.0.6",

@@ -55,0 +54,0 @@ "lodash.merge": "4.6.0",

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