
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
csv-parse
Advanced tools
The csv-parse package is a parser converting CSV text input into arrays or objects. It is part of the CSV project.
It implements the Node.js stream.Transform API. It also provides a simple callback-based API for convenience. It is both extremely easy to use and powerful. It was first released in 2010 and is used against big data sets by a large community.
Run npm install csv to install the full CSV module or run npm install csv-parse if you are only interested by the CSV parser.
Use the callback and sync APIs for simplicity or the stream based API for scalability.
The API is available in multiple flavors. This example illustrates the stream API.
import assert from "assert";
import { parse } from "csv-parse";
const records = [];
// Initialize the parser
const parser = parse({
delimiter: ":",
});
// Use the readable stream api to consume records
parser.on("readable", function () {
let record;
while ((record = parser.read()) !== null) {
records.push(record);
}
});
// Catch any error
parser.on("error", function (err) {
console.error(err.message);
});
// Test that the parsed records matched the expected records
parser.on("end", function () {
assert.deepStrictEqual(records, [
["root", "x", "0", "0", "root", "/root", "/bin/bash"],
["someone", "x", "1022", "1022", "", "/home/someone", "/bin/bash"],
]);
});
// Write data to the stream
parser.write("root:x:0:0:root:/root:/bin/bash\n");
parser.write("someone:x:1022:1022::/home/someone:/bin/bash\n");
// Close the readable stream
parser.end();
The project is sponsored by Adaltas, an Big Data consulting firm based in Paris, France.
Papa Parse is a powerful CSV parser that can handle large files and malformed input gracefully. It works in both browser and server environments. Compared to csv-parse, Papa Parse has a more user-friendly API and can automatically detect delimiters.
Fast-csv is another CSV parsing and formatting library for Node.js. It provides a simple API and supports both stream and callback-based processing. It is known for its speed and efficiency, but csv-parse offers more advanced features and customization options.
csvtojson is a full-featured CSV parser library that converts CSV to JSON. One of its main differences from csv-parse is that it focuses on the JSON output format, whereas csv-parse provides more flexibility in handling the parsed data.
FAQs
CSV parsing implementing the Node.js `stream.Transform` API
The npm package csv-parse receives a total of 7,816,014 weekly downloads. As such, csv-parse popularity was classified as popular.
We found that csv-parse demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.