Comparing version
{ | ||
"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 @@ | ||
     | ||
## 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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
908216
0.12%3525
0.09%0
-100%218
12.37%7
-12.5%