gulp-xlsx2html

0.3.0 • Public • Published

gulp-xlsx2html npm version Build Status Dependency Status devDependency Status

gulp-xlsx2html is Gulp extension to convert XLSX file to HTML in the pipeline. Gulp is a streaming build system utilizing node.js.

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

Usage

// single template
gulp.src('./data.xlsx')
    .pipe(xlsx2html('./tmpl/tmpl.hbs'))
    .pipe(gulp.dest('./dist/');
 
// multiple template
gulp.src('./data.xlsx')
    .pipe(xlsx2html({
        templateType1: './tmpl/type1.hbs',
        templateType2: './tmpl/type2.hbs'
    }, {
        header: 0,
        type: 1
    }))
    .pipe(gulp.dest('./dist/');

API

xlsx2html(tmplFilePath [, options])

tmplFilePath

1. single template
  • Type: string
  • Required

The template file path of handlebars.

2. multiple template
  • Type: [ tmplType: string ]: string
  • Required

Template files path of handlebars in hash object.

tmplType is value of the field name __TMPL_TYPE__ in XLSX file.

ex)

xlsx2html({
    templateType1: './tmpl/type1.hbs',
    templateType2: './tmpl/type2.hbs'
})

options

  • Type: Object
  • Optional
  • Default undefined

The optional parameters.

key type default summary
header number 0 the row number of field name header in XLSX file.
type number 1 the row number of field type in XLSX file.
label number null the row number of label in XLSX file.
description number null the row number of description in XLSX file.

Contribution

Install

$ npm install
$ dtsm install

Compile

$ tsc index.ts --module commonjs

Test

$ npm test

Package Sidebar

Install

npm i gulp-xlsx2html

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • yusukehirao