1.0.1 • Published 3 years ago

json2xlsx-ws v1.0.1

Weekly downloads
114
License
MIT
Repository
github
Last release
3 years ago

json2xlsx-ws NPM version

Converts object arrays to xlsx worksheets

yarn add json2xlsx-ws

Usage

import { json2xlsx } from "json2xlsx-ws";
import * xslx from "xlsx";

// Headers are generated from the first object in the data array
const data = [
  {
    number: "number",
    string: "string",
    date: "date",
  },
  {
    number: 1,
    string: "string1",
    date: Date(),
  },
  {
    number: 2,
    string: "string2",
    date: Date(),
  },
];

xlsx.writeFile(
  {
    SheetNames: ["Sheet1", "Sheet2"],
    Sheets: {
      Sheet1: json2xlsx(data),
      Sheet2: json2xlsx(data),
    },
  },
  "workbook.xlsx"
);

Contributing

I'd love for you to contribute and make json2xlsx-ws even better than it is today!

Getting started

git clone https://github.com/Zertz/json2xlsx-ws.git
yarn
yarn test
1.0.1

3 years ago

1.0.0

3 years ago

0.1.1

8 years ago

0.1.0

8 years ago