Files
liquidjs/bin/liquid.js
T
harttle fc045b5bbc feat: CLI support
echo '{{ "hello" | capitalize }}' | liquidjs
2019-08-01 13:15:55 +08:00

13 lines
287 B
JavaScript
Executable File

#!/usr/bin/env node
const Liquid = require('..')
let tpl = ''
process.stdin.on('data', chunk => (tpl += chunk))
process.stdin.on('end', () => render(tpl))
async function render (tpl) {
const liquid = new Liquid()
const html = await liquid.parseAndRender(tpl)
console.log(html)
}