tablests
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

tables.ts 📄

Tiny utility for parsing CSV files.

  • dead simple, just a few lines of code
  • needs the entire CSV in memory
  • no dependencies
  • written in TypeScript
npm i tablests

Usage

import { stringify, parse } from 'tablests';

const data = [
    ['id', 'name', 'age', 'weight', 'married', 'children', 'timestamp'],
    ['1', '"Dan, John"', '30', '80.5', 'true', '2', '2021-01-01T00:00:00.000Z'],
    ['2', '"Jack"', '40', '90.5', 'false', '0', '2021-01-02T00:00:00.000Z'],
    ['3', 'Back, "Jim"', '50', '"100.5"', 'true', '3', '2021-01-03T00:00:00.000Z'],
];

const csvString = stringify(csvData);
const originalData = parse(csvString);

Package Sidebar

Install

npm i tablests

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.2 kB

Total Files

8

Last publish

Collaborators

  • vojtatom