🚀 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
1.0.0

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

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

@@ -0,1 +1,3 @@

![download](https://img.shields.io/npm/dt/js2excel.svg) ![dep](https://img.shields.io/david/dwqs/js2excel.svg) ![npm-version](https://img.shields.io/npm/v/js2excel.svg) ![license](https://img.shields.io/npm/l/js2excel.svg) ![bower-license](https://img.shields.io/bower/l/js2excel.svg)
## js2excel

@@ -85,3 +87,3 @@ A simple module for excel and json converts each other.

### Convert excel to json
### Convert excel(.numbers/.xlsx/.xls) to json
```

@@ -91,3 +93,3 @@ import { excel2json } from 'js2excel';

// html
<input type="file" multiple="false" id="sheets" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="onchange" />
<input type="file" multiple="false" id="sheets" accept="application/x-iwork-keynote-sffnumbers,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="onchange" />

@@ -160,3 +162,3 @@ // methods

### excel2json(files, cb(data), [defval])
Convert excel(.xlsx/.xls) to json.
Convert excel(.numbers/.xlsx/.xls) to json.

@@ -191,2 +193,24 @@ **files**

### csv2json(files, cb(data), [encode])
Convert CSV file to json.
**files**
Type: `Array`
[FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList) from `<input type='file' multiple="false" >`.
**cb(data)**
Type: `Function`
Callback function called on finish.
**encode**
Type: `String`
Default: `UTF-8`
The default encode when reading file.
## Supported browsers

@@ -193,0 +217,0 @@ * [FileSaver#supported-browsers](https://github.com/eligrey/FileSaver.js#supported-browsers)

@@ -10,3 +10,4 @@ export interface Params {

json2excel: (opts: Params) => void;
csv2json: (files: File[], cb: CallBack, encode?: string) => any;
};
export default js2excel;

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