Liquid templates are highly readable and fault-tolerant thus suitable for designers and customers. Operators and expressions are parsed to AST and no eval
or new Function
are used.
Written with pure JavaScript with no native bindings, available in both Node.js and browsers. All of the CMD, ESM and CJS bundles are available on CDN.
All filters and tags from Ruby shopify/liquid are supported by LiquidJS. Jekyll sites, GitHub Pages and Shopify templates can be ported to Node.js without pain.
The whole repo is re-written in TypeScript strict mode to ensure a smooth experience using this lib and the document is precise and always up to date.
import { Liquid } from 'liquidjs'
const engine = new Liquid()
const tpl = engine.parse('Welcome to {{v}}!')
engine.render(tpl, {v: "Liquid"}).then(console.log)
// Outputs "Welcome to Liquid!"
LiquidJS follows the all-contributors specification, see guidelines here! Thanks goes to these wonderful people: