offin

0.0.3 • Public • Published

Offin

A simple library for injecting JSON data into Microsoft Office XML document templates - docx, xlsx, pptx

This uses docxtemplater and xslx-template to accomplish this. For consistency, all file types use mustache style tokens:

{firstName} {lastName}

To see how templating works:

Installation

npm install offin [--save]

Sample Code (coffeescript)

Excel

offin = require("offin")

data =
  firstName: "Joe"
  lastName: "Dirt"

options =
  template: "./template.xlsx"
  output: "./output.xlsx"
  data: data
  
offin.xlsx options 

Word

offin = require("offin")

data =
  firstName: "Joe"
  lastName: "Dirt"

options =
  template: "./template.docx"
  output: "./output.docx"
  data: data
  
offin.docx options 

Powerpoint

offin = require("offin")

data =
  firstName: "Joe"
  lastName: "Dirt"

options =
  template: "./template.pptx"
  output: "./output.pptx"
  data: data
  
offin.pptx options 

Changelog

0.0.1

  • Initial release

Open Source Attributions

Dependents (0)

Package Sidebar

Install

npm i offin

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

138 kB

Total Files

14

Last publish

Collaborators

  • braintapper