@calipsa/array-to-csv
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@calipsa/array-to-csv

NPM version Downloads Dependency status Dev Dependency status

Installation

# using npm:
npm install --save @calipsa/array-to-csv

# or if you like yarn:
yarn add @calipsa/array-to-csv

Usage

import arrayToCsv from '@calipsa/array-to-csv'

const columns = [
  'col1',
  'col2',
  {
    key: 'col3',
    label: 'Column 3',
  },
  {
    key: 'col4',
    label: 'Column 4 (uppercase)',
    transform: (val) => val.toUpperCase(),
  },
]

// get the converter
const toCsv = arrayToCsv(columns)
// get the csv
const result = toCsv(list)
console.log(result)

Readme

Keywords

Package Sidebar

Install

npm i @calipsa/array-to-csv

Weekly Downloads

74

Version

1.1.1

License

ISC

Unpacked Size

14 kB

Total Files

21

Last publish

Collaborators

  • balaphp
  • inker
  • usama.ashraf