render-json
Render JSON data into your template.
Install
$ npm install --save render-json
Usage
const render = const options = input: 'package.json' output: 'README.md' template: 'README_template.hbs' // handlebars syntax
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