0.0.3 • Published 3 years ago

offin v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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