1.0.0 • Published 7 years ago

ryuk v1.0.0

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

ryuk

a light weight ES6 Template literals Markup system

Installation

$ yarn add ryuk

If you prefer using npm:

$ npm i -S ryuk

Usage

// file template/mapping.map.ryk

#coockie_value  backendname

${vm.list.map(({name, id}) => `${name}  ${id}`).join('\n')}

compile a file and assign it to a variable

const ryuk = require('ryuk')

const list = [{name: 'red', id: 'VDC_1'}, {name: 'blue', id: 'VDC_2'}, {name: 'green', id: 'VDC_3'}]
const compiled = ryuk.compile(`template/mapping.map.ryk`, { list })

compile a file and write the output to another file

const ryuk = require('ryuk')

const list = [{name: 'red', id: 'VDC_1'}, {name: 'blue', id: 'VDC_2'}, {name: 'green', id: 'VDC_3'}]
ryuk.render(`template/mapping.map.ryk`, { list }, `output/mapping.map`)

the output will be

// output/mapping.map

#coockie_value  backendname

red  VDC_1
blue  VDC_2
green  VDC_3