Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
csv-es
Advanced tools
Readme
CSV-ES is a universal JavaScript CSV parser designed specifically to be simple, fast, and spec compliant.
npm install csv-es
import * as CSV from 'csv-es';
or
import { parse, stringify } from 'csv-es';
Takes a string of CSV data and converts it to a 2 dimensional array of [entries][values]
CSV.parse(csv, {options}, reviver(value, row, col)) : [entries][values]
false
)(value) => value
)1 Values for row
and col
are 1-based.
import CSV from '/path/to/csv/index.js';
const csv = `
"header1,header2,header3"
"aaa,bbb,ccc"
"zzz,yyy,xxx"
`;
const parsed = CSV.parse(csv)
console.log(parsed);
> [
> [ "header1", "header2", "header3" ],
> [ "aaa", "bbb", "ccc" ],
> [ "zzz", "yyy", "xxx" ]
> ]
Takes a 2 dimensional array of [entries][values]
and converts them to CSV
CSV.stringify(array, {options}, replacer(value, row, col)) : string
true
)(value) => value
)1 Values for row
and col
are 1-based.
import CSV from '/path/to/csv/index.js';
const data = [
[ "header1", "header2", "header3" ],
[ "aaa", "bbb", "ccc" ],
[ "zzz", "yyy", "xxx" ]
];
const stringified = CSV.stringify(data)
console.log(stringified);
> "header1,header2,header3"
> "aaa,bbb,ccc"
> "zzz,yyy,xxx"
A .cjs
bundle is included for CommonJS compatibility
const CSV = require('csv-es');
const csv = // the csv string
const data = CSV.parse(csv);
const CSV = require('csv-es');
const data = // the a 2-dimensional array
const csv = CSV.stringify(data);
Typings are generated from JSDoc using Typescript. They are 100% compatible with VSCode Intellisense and will work seamlessly with Typescript.
FAQs
A modern, fast, RFC 4180 compliant parser for JS
The npm package csv-es receives a total of 55 weekly downloads. As such, csv-es popularity was classified as not popular.
We found that csv-es 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.