Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
then-busboy
Advanced tools
Promise-based wrapper around Busboy, inspired by async-busboy
Use can install then-pusboy
from npm:
npm install then-busboy --save
Or with yarn
yarn add then-busboy
yarn
true
, the data
object will be split into two other objects: fields
and files
.Just import then-busboy
and pass request
object as first argument.
For example:
var busboy = require("then-busboy");
var createServer = require("http").createServer;
function callback(req, res) {
if (req.method === "GET") {
res.statusCode = 404
return res.end("Not Found");
}
if (req.method !== "POST") {
res.statusCode = 405;
return res.end("Method Not Allowed");
}
// Get result from then-busboy
function onFulfilled(data) {
res.writeHead("Content-Type", "application/json");
res.end(JSON.stringify(data));
}
// Handle errors
function onRejected(err) {
res.statusCode = err.status || 500;
res.end(String(err));
}
// Call `then-busboy` with `req`
busboy(req).then(onFulfilled, onRejected);
}
createServer(callback)
.listen(2319, () => console.log("Server started on http://localhost:2319"));
then-busboy
always returns a Promise, so you can use it with
asynchronous function syntax:
// Some of your awesome code with async workflow...
var data = await busboy(req);
And the same code, but with split: true
option:
var {fields, files} = await busboy(req, {split: true});
FAQs
Promise-based wrapper around Busboy. Processes multipart/form-data request body and returns it in a single object.
The npm package then-busboy receives a total of 81 weekly downloads. As such, then-busboy popularity was classified as not popular.
We found that then-busboy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.