
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
async-multipart-iterator
Advanced tools
Iterate the parts of an RFC 1528 multipart (multipart/mixed, multipart/alternative, multipart/digest, multipart/parallel) document, sequentially producing a header and a body iterator for each part.
'use strict'
const someInputFile = 'something'; // name of a multipart file to be parsed
const someOutputDir = '/tmp/something'; // name of a directory in which bodies of each of the parts will be written
const boundary = 'cd67d1a112145bdcfdce0c5839b36b53'; // the boundaries to be found in the input file
const fs = require('fs');
const {multipartIterator} = require('async-multipart-iterator');
async function main() {
const input = fs.createReadStream(someInputFile);
let count = 0;
for await (let [header, bodyIterator] of multipartIterator(boundary, input)) {
// here for each part of the document
console.log(header) // right now just an array of unparsed lines from the part's header
const stream = fs.createWriteStream(`{someOutputFile}/${count++}`);
for await (let chunk of bodyIterator) {
await new Promise( (res,rej) => stream.write(chunk, res));
}
await new Promise( (res,rej) => stream.end(res));
}
}
main().catch(console.error)
FAQs
Iterate over the parts of a multipart document
The npm package async-multipart-iterator receives a total of 0 weekly downloads. As such, async-multipart-iterator popularity was classified as not popular.
We found that async-multipart-iterator 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.