Skip to content

mouafa/ryuk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

ES6 Template literals Markup system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published