1.0.4 ā€¢ Published 1 year ago

js2xlsx v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

download npm-version license

js2xlsx

šŸ˜Œ šŸ˜ƒ šŸ‘æ A simple module for excel and js converts each other, which works in the browser and can be used to help manage multilingual entries and so on.

Installation

It is recommended to run webpack on node 10.x or higher.

Install the pkg with npm:

npm install js2xlsx --save

Usage

Convert js to excel(.xlsx/.xls)

// es6
import {js2excel} from 'js2xlsx';

//CommonJS
let { js2excel } = require('js2xlsx');

js2excel('../src/lang','../src/lang.xlsx');

// for webpack 3: dynamic import

    import(/* webpackChunkName: "js2xlsx" */ 'js2xlsx').then(({js2excel}) => {
      js2excel('../src/lang','../src/lang.xlsx');
    }).catch((e) => {
    });
    

Convert excel(.xlsx/.xls) to js

// es6
import {excel2js} from 'js2xlsx';

//CommonJS
let { excel2js } = require('js2xlsx');

excel2js('../src/lang','../src/lang.xlsx');

// for webpack 3: dynamic import

    import(/* webpackChunkName: "js2xlsx" */ 'js2xlsx').then(({excel2js}) => {
      excel2js('../src/lang','../src/lang.xlsx');
    }).catch((e) => {
    });
    

API

js2excel(opts)

Convert js to excel(.xlsx/.xls).

opts Type: Object

opts.filePath

Type: String

Excel's file path.

opts.fileName

Type: String

Excel's name, whose suffix is .xlsx or .xls.

excel2js(opts)

Convert excel(.xlsx/.xls) to js.

opts Type: Object

opts.filePath

Type: String

Excel's file path.

opts.fileName

Type: String

Excel's name, whose suffix is .xlsx or .xls.

Supported browsers

License

MIT

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago