zx_excel

1.0.0 • Public • Published

HEAD

zx_excel

介绍

本类提供把json格式的数据转换成Excel格式。xlsx格式。

软件架构

类 Excel

方法

    json2Excel(header,dataJson,filenameOutput)

安装教程

npm install zx_excel --save

使用说明

引用类
      const Excel= require("./excel");
      const excel = new Excel();

json2Excel(header,dataJson,filenameOutput)

样例:
    var header =["id","name","age","country","remark"];
    var data =[
        { id:1,
            name:"test1",
            age:"30",
            country:"China",
            remark:"hello"},
        {id:"2",
            name:"test2",
            age:"20",
            country:"America",
            remark:"world" },
        {id:"3",
            name:"test3",
            age:"18",
            country:"unkown",
            remark:"???" }
    ];
    excel.json2Excel(header,data,"output");

    header为标题,data要转换的json数据,output为要写的excel文件名,写出的文件为output.xlsx

参与贡献

zx

end

Package Sidebar

Install

npm i zx_excel

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

18.7 kB

Total Files

5

Last publish

Collaborators

  • menghuiqiang999