1.0.0-alpha.1 • Published 7 years ago

export.js v1.0.0-alpha.1

Weekly downloads
22
License
-
Repository
-
Last release
7 years ago

export.js

Export a table-like data to xlsx, xls, docx, doc, csv, txt, and xml files

Struct data

  const data: IData[]

  interface IData {
    th?: string[]
    td: string[][]
  } 

Usage

install

npm i export.js --save

typescript

import { exportCSV } from 'export.js/csv'

const data = [{
  th: ['1', '2', '3'],
  td: [
    ['a', 'b', 'c'],
    ['d', 'e', 'f', 'g'],
  ]
}]
exportCSV('filename', data)

with script

<scritp src="dist/export.min.js"></script>
<script>
var data = [{
  th: ['1', '2', '3'],
  td: [
    ['a', 'b', 'c'],
    ['d', 'e', 'f', 'g'],
  ]
}]
exp.csv('filename', data)
</script>

Other file type like txt is similar

Dependencies

Browsers

  • use modern browsers like Chrome, Safari, Firefox, Edge is safe and wonderful