@momsfriendlydevco/spreadsheet-handlebars

Handlebars based templates for spreadsheets

Please use @momsfriendlydevco/spreadsheet-templater
Last updated 2 years ago by hash-bang .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @momsfriendlydevco/spreadsheet-handlebars 
SYNC missed versions from official npm registry.

Spreadsheet-Handlebars

Handlebars integration for spreadhssets (via XLSX).

This plugin allows a spreadsheet to use handlebars notation to replace cell contents which enables an input spreadsheet to act as a template for incomming data.

var SpreadsheetHandlebars = require('@momsfriendlydevco/spreadsheet-handlebars');

new SpreadsheetHandlebars('input.xlsx')
	.data({...})
	.apply()
	.write('output.xlsx')

API

The module exposes a single object.

Constructor(options | filename)

Setup the object either with an options object or a template filename to use.

set(key, [val])

Set a single or multiple options (if key is an object). Lodash array and dotted notation is supported for the key.

readTemplate()

Parse the input template file. This function is automatically called if constructor is given a filename when initialized.

apply([data])

Apply the given data (or the data specified in options.data) to the loaded template.

json()

Convenience function to return the workbook as a JSON object This will return an object with each key as the sheet ID and a 2D array of cells

Current Tags

  • 0.0.0                                ...           latest (2 years ago)

1 Versions

  • 0.0.0 [deprecated]           ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |