JSPM

@voidvoxel/csv

2.0.0-alpha.1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q8582F
  • License MPL-2.0

CSV analogue to the standard JSON module

Package Exports

  • @voidvoxel/csv
  • @voidvoxel/csv/csv.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@voidvoxel/csv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@voidvoxel/csv

csv is designed to be a CSV analogue to the standard JSON module.

Installation

npm i @voidvoxel/csv

Importing

Module

import * as CSV from "@voidvoxel/csv";

CommonJS

const CSV = require("@voidvoxel/csv");

Usage

Parse

const csv = `name,gender,age
Ashlynn,female,25
Haley,female,25
Carlos,male,28
Kua,male,23`;

const array = CSV.parse(csv);

console.log(array);

Stringify

const array = [
  { name: 'Ashlynn', gender: 'female', age: '25' },
  { name: 'Haley', gender: 'female', age: '25' },
  { name: 'Carlos', gender: 'male', age: '28' },
  { name: 'Kua', gender: 'male', age: '23' }
];

const csv = CSV.stringify(array);

console.log(csv);