vanillaes / Csv
Licence: mit
A modern, fast, RFC 4180 compliant parser for JS
Stars: ✭ 38
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Csv
carsBase
База автомобилей с марками и моделями JSON, CSV, XLSX и MySQL
Stars: ✭ 49 (+28.95%)
Mutual labels: csv, parse
React Csv Reader
React component that handles csv file input and its parsing
Stars: ✭ 138 (+263.16%)
Mutual labels: csv, parse
Node Csvtojson
Blazing fast and Comprehensive CSV Parser for Node.JS / Browser / Command Line.
Stars: ✭ 1,760 (+4531.58%)
Mutual labels: csv, parse
exoffice
Library to parse common excel formats (xls, xlsx, csv)
Stars: ✭ 31 (-18.42%)
Mutual labels: csv, parse
Nb Choices
Angular wrapper for choices.js, vanilla, lightweight, configurable select box/text input plugin
Stars: ✭ 32 (-15.79%)
Mutual labels: vanilla
English synonyms antonyms list
List of English synonyms and antonyms parsed from the public domain book of James C. Fernald, 1896
Stars: ✭ 20 (-47.37%)
Mutual labels: csv
Clevercsv
CleverCSV is a Python package for handling messy CSV files. It provides a drop-in replacement for the builtin CSV module with improved dialect detection, and comes with a handy command line application for working with CSV files.
Stars: ✭ 887 (+2234.21%)
Mutual labels: csv
Data Forge Ts
The JavaScript data transformation and analysis toolkit inspired by Pandas and LINQ.
Stars: ✭ 967 (+2444.74%)
Mutual labels: csv
Vanilla Todo
A case study on viable techniques for vanilla web development.
Stars: ✭ 951 (+2402.63%)
Mutual labels: vanilla
Byte
A low-level, zero-copy, panic-free, binary serializer and deserializer. (parser and encoder)
Stars: ✭ 29 (-23.68%)
Mutual labels: parse
CSV
CSV is a universal JavaScript CSV parser designed specifically to be simple, fast, and spec compliant.
Features
- RFC Compliant
- ECMAScript Module
- CommonJS Compatible
- Typescript Compatible
Installation
npm install @vanillaes/csv
CSV.parse()
Takes a string of CSV data and converts it to a 2 dimensional array of [entries][values]
Arguments
CSV.parse(csv, {options}, reviver(value, row, col)) : [entries][values]
- csv - the CSV string to parse
- options
- typed - infer types (default
false
)
- typed - infer types (default
- reviver1 - a custom function to modify the output (default
(value) => value
)
1 Values for row
and col
are 1-based.
Example
import { parse } from '@vanillaes/csv';
const csv = `
"header1,header2,header3"
"aaa,bbb,ccc"
"zzz,yyy,xxx"
`;
const parsed = parse(csv)
console.log(parsed);
> [
> [ "header1", "header2", "header3" ],
> [ "aaa", "bbb", "ccc" ],
> [ "zzz", "yyy", "xxx" ]
> ]
CSV.stringify()
Takes a 2 dimensional array of [entries][values]
and converts them to CSV
Arguments
CSV.stringify(array, {options}, replacer(value, row, col)) : string
- array - the input array to stringify
- options
- eof - add a trailing newline at the end of file (default
true
)
- eof - add a trailing newline at the end of file (default
- replacer1 - a custom function to modify the values (default
(value) => value
)
1 Values for row
and col
are 1-based.
Example
import { stringify } from '@vanillaes/csv';
const data = [
[ "header1", "header2", "header3" ],
[ "aaa", "bbb", "ccc" ],
[ "zzz", "yyy", "xxx" ]
];
const stringified = stringify(data)
console.log(stringified);
> "header1,header2,header3"
> "aaa,bbb,ccc"
> "zzz,yyy,xxx"
CommonJS
A .cjs
bundle is included for CommonJS compatibility
CSV.parse()
const CSV = require('@vanillaes/csv');
const csv = // the csv string
const data = CSV.parse(csv);
CSV.stringify()
const CSV = require('@vanillaes/csv');
const data = // the a 2-dimensional array
const csv = CSV.stringify(data);
Typescript
Typings are generated from JSDoc using Typescript. They are 100% compatible with VSCode Intellisense and will work seamlessly with Typescript.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].