render-json
Render JSON data into your template
Last updated 4 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install render-json 
SYNC missed versions from official npm registry.

render-json NPM version NPM downloads Build Status XO code style

Render JSON data into your template.

Install

$ npm install --save render-json

Usage

const render = require('render-json')

const options = {
  input: 'package.json',
  output: 'README.md'
  template: 'README_template.hbs' // handlebars syntax
}

render(options)
  .then(() => {
    console.log('done!')
  })

Template data

{
  json: {}, // parsed input file
  year: 2016 // current year
}

Or the input itself if it's an object.

API

render(options)

options

input

Type: string object
Required: true

  • string Path to input file.
  • object Directly use given object to render template.
output

Type: string
Required: true

Path to output file.

template

Type: string
Required: true

Path to template, handlebars syntax by default.

isPackageJson

Type: boolean
Default: false

Whether the input file should be treated as package.json.

force

Type: boolean
Default: false

Overwrite the output file.

License

MIT © EGOIST

Current Tags

  • 1.0.0                                ...           latest (4 years ago)

1 Versions

  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |