0.3.0 • Published 9 years ago

gulp-xlsx2html v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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.

keytypedefaultsummary
headernumber0the row number of field name header in XLSX file.
typenumber1the row number of field type in XLSX file.
labelnumbernullthe row number of label in XLSX file.
descriptionnumbernullthe row number of description in XLSX file.

Contribution

Install

$ npm install
$ dtsm install

Compile

$ tsc index.ts --module commonjs

Test

$ npm test