2.0.1 • Published 3 years ago

simple-js-export v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

npm npm

  • Quick & Simple export to CSV .

Note

V2 is still going on. See V1 for full functions.

Install

 npm i simple-js-export

Example

const SimpleJsExport = require("simple-js-export")
const data = [...Array(100)].map((item, index) => {
  return {
    name: "name" + index,
    code: "code" + index,
    year: "year" + index,
  }
})
const columns = [
  { title: "NAME", dataIndex: "name" },
  { title: "CODE", dataIndex: "code" },
  { title: "YEAR", dataIndex: "year" },
]
SimpleJsExport({ data, columns }).save()

Well, it seems a real trouble to set Column both title & dataIndex every time.
It is also allowed to set Only the title, provided that each item in the data has the same format content.

const SimpleJsExport = require("simple-js-export")
const data = [...Array(100)].map((item) => {
  return {
    name: "name" + item,
    code: "code" + item,
    year: "year" + item,
  }
})
const columns = ["NAME", "CODE", "YEAR"]
SimpleJsExport({ data, columns }).save()

Option Properties

PropertyDescriptionRequiredTypeDefault
dataData to be exported into fileArray[]
columnsColumns setting of datasource configArray[]
fileNameFilename to exportStringsimple-js-export
delimiterDelimiterString,

Column

PropertyDescriptionRequiredTypeDefault
titleTitle of the columnString-
dataIndexField of the data recordString-
forceStringDate expected to be String typeBooleanfalse
2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

4 years ago

0.1.0

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago