🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

js2excel

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js2excel - npm Package Compare versions

Comparing version

to
0.7.9

{
"name": "js2excel",
"version": "0.7.8",
"version": "0.7.9",
"author": "pomysky@gmail.com",

@@ -5,0 +5,0 @@ "description": "A simple module for excel and json converts each other",

@@ -36,32 +36,5 @@ ## js2excel

/**
* excel's data
**/
// excel's columns's header
let headers = [
// excel's data will be exports, which you probably get it from server.
let data = [
{
// the name will be as the excel column name
name: 'User Id',
// the prop will be as the excel row data, which is the rows' item's property.
prop: 'userId'
},
{
name: 'Phone Number',
prop: 'userPhoneNumber'
},
{
name: 'User Address',
prop: 'userAddress'
},
{
name: 'Date',
prop: 'date'
}
];
// excel rows' data
// rows' data will be exports, which you probably get it from server.
let rows = [
{
"userId": 1,

@@ -90,3 +63,3 @@ "userPhoneNumber": 1888888888,

json2excel({
headers, rows,
data
name: 'user-info-data',

@@ -102,4 +75,4 @@ formateDate: 'yyyy/mm/dd'

json2excel({
headers, rows,
name: 'user-info-data',
data
name: 'test',
formateDate: 'dd/mm/yyyy'

@@ -113,3 +86,3 @@ });

![user-data](https://sfault-image.b0.upaiyun.com/122/505/1225057000-5960fb885c904_articlex)
![test-data](https://sfault-image.b0.upaiyun.com/148/574/1485742647-5961130140811_articlex)

@@ -157,12 +130,4 @@ ### Convert excel to json

`opts.headers`
`opts.data`
Type: `Array`
Default: []
Excel's column's headers.
`opts.rows`
Type: `Array`,

@@ -172,3 +137,3 @@

Excel's rows's data.
Excel's data.

@@ -175,0 +140,0 @@ `opts.name`

export interface Params {
headers: any[];
rows: any[];
data: any[];
name?: string;

@@ -5,0 +4,0 @@ formateDate?: string;

Sorry, the diff of this file is too big to display