txt-template

0.2.2 • Public • Published

txt-template Build Status js-standard-style

TXT templating with mustache.js

Installation

npm install --save txt-template

Usage

const txtTemplate = require('txt-template')
 
txtTemplate({
  template: 'example.txt',
  output: 'output.txt',
  data: {
    name: 'John Doe',
    age: 26,
    email: 'johndoe@example.com',
    birthdate: '01/01/1990',
    projects: ['project1', 'project2', 'project3']
  }
}).then((res) => {
  console.log(res)
}).catch((err) => {
  console.error(err)
})

Testing

npm run test

License

MIT LICENSE.md

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with <3 by amimaro

Package Sidebar

Install

npm i txt-template

Weekly Downloads

1

Version

0.2.2

License

MIT

Unpacked Size

3.44 kB

Total Files

4

Last publish

Collaborators

  • amimaro