npm.io
1.0.5 • Published 7 years ago

gulp-xlsx2json

Licence
MIT
Version
1.0.5
Deps
3
Size
6 kB
Vulns
5
Weekly
0
Stars
1

gulp-xlsx2json

Excel (XLSX/XLS) to json. If there is a headRow specified, export each line to an object. Otherwise export each line to an array.

Usage

First, install gulp-xlsx2json as a development dependency:

> npm install --save-dev gulp-xlsx2json

Then, add it to your gulpfile.js:

var xlsx2json = require('gulp-xlsx2json');

gulp.task('copy', function() {
    gulp.src('config/**.xlsx')
        .pipe(xlsx2json({
            headRow: 1,
            valueRowStart: 3,
            trace: true
        }))
        .pipe(gulp.dest('build'))
});

API

xlsx2json([options])
options.headRow

Type: number

Default: 1

The row number of head. (Start from 1).

options.valueRowStart

Type: number

Default: 3

The start row number of values. (Start from 1)

options.trace

Type: Boolean

Default: false

Whether to log each file path while convert success.

License

MIT Chris

Keywords