liquidjs
TypeScript icon, indicating that this package has built-in type declarations

10.10.1 • Public • Published

liquidjs

npm version npm downloads Coverage Build Status DUB license semantic-release

A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript. The purpose of this repo is to provide a standard Liquid implementation for the JavaScript community so that Jekyll sites, Github Pages and Shopify templates can be ported to Node.js without pain.

logo

What's it like?

Basically there're two types of Liquid syntax: tags enclosed by {% %} and outputs enclosed by {{ }}. A Liquid template looks like:

{% if username %}
  {{ username | append: ", welcome to LiquidJS!" | capitalize }}
{% endif %}

A live demo is also available and here's a quick tutorial for Liquid syntax.

Installation

Install from npm in Node.js:

npm install liquidjs

Or use the UMD bundle from jsDelivr:

<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>

Or render directly from CLI using npx:

npx liquidjs --template 'Hello, {{ name }}!' --context '{"name": "Snake"}'

For more details, refer to the Setup Guide.

Who's Using LiquidJS?

  • Eleventy: Eleventy, a simpler static site generator.
  • Opensense: The smarter way to send email.
  • Directus: an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.
  • Semgrep: Lightweight static analysis for many languages.
  • Rock: An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
  • Mitosis: Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more.
  • Pattern Lab: a frontend workshop environment that helps you build, view, test, and showcase your design system's UI components.
  • Builder.io: the first and only headless CMS with a visual editor that lets you drag and drop with your components, directly within your current site or app. Completely API-driven, for cleaner code and simpler workflows.
  • Microsoft Power Pages: a secure, enterprise-grade, low-code software as a service (SaaS) platform for creating, hosting, and administering modern external-facing business websites.
  • Azure API Management developer portal: an automatically generated, fully customizable website with the documentation of your APIs.

Feel free to create a PR or contact me to add your use case into this list!

Financial Support

If you love LiquidJS or your company is using LiquidJS, please consider financial support.

Backers

If you personally like LiquidJS and find it useful to you, buy me a coffee!💖

Sponsors

If LiquidJS is benefiting your business/company, please sponsor us to contribute to our effort!

Contributors ✨

Want to contribute? see Contribution Guidelines. Thanks goes to these wonderful people:

Jun Yang
Jun Yang

🚧 💻
chenos
chenos

💻
Zach Leatherman
Zach Leatherman

🐛
Tim Hardy
Tim Hardy

💻
Paul Robert Lloyd
Paul Robert Lloyd

💻 🐛
Alec Larson
Alec Larson

💻
Patrick Malouin
Patrick Malouin

💻 📖
jaswrks
jaswrks

💻
三三
三三

💻 🤔
ssendev
ssendev

💻 📖
wojtask9
wojtask9

💻
Andrew Barclay
Andrew Barclay

💻
Cory Mawhorter
Cory Mawhorter

💻
Mehdi Jaffery
Mehdi Jaffery

💻
Robin Bijlani
Robin Bijlani

💻 🐛
Ryan Kennedy
Ryan Kennedy

💻
Sami Kukkonen
Sami Kukkonen

💻
Scott Santucci
Scott Santucci

💻
Steven
Steven

💡 💻
azu
azu

📖
Joonas
Joonas

💻
Jamel A.
Jamel A.

💻
Brandon Pittman
Brandon Pittman

💻
tgrandgent
tgrandgent

💻
Martin Schuster
Martin Schuster

💻
Ray
Ray

⚠️ 💻
Cristofer Gonzales
Cristofer Gonzales

💻
Raymond Camden
Raymond Camden

📖
Steve Stedman
Steve Stedman

📖
Anthony Ciccarello
Anthony Ciccarello

📖
Bogdan Chadkin
Bogdan Chadkin

💻
Tejas Manohar
Tejas Manohar

💻
Peter deHaan
Peter deHaan

📖
amit777
amit777

💻 💵
Steffen Schuldenzucker
Steffen Schuldenzucker

💻
Pixcell
Pixcell

💻
Jason Etcovitch
Jason Etcovitch

💻
ZC
ZC

📖
Memmie Lenglet
Memmie Lenglet

💻
ilhamdev0
ilhamdev0

📖
一饮一啄皆是人生
一饮一啄皆是人生

📖
Amit Agarwal
Amit Agarwal

📖
Laurin Quast
Laurin Quast

💻
Matt Vague
Matt Vague

💻
Liam Bigelow
Liam Bigelow

💻
Jason Kurian
Jason Kurian

📖
d pham (they/them)
d pham (they/them)

📖
Aleksandr Hovhannisyan
Aleksandr Hovhannisyan

💻
jg-rp
jg-rp

💻
Ameya Apte
Ameya Apte

💻
tbdrz
tbdrz

📖
Santi Albo
Santi Albo

📖
Yahang Wu
Yahang Wu

📖
hongl
hongl

📖
zxx-457
zxx-457

📖
prassie
prassie

📖
Slav Ivanov
Slav Ivanov

💻
Daniel Rosenberg
Daniel Rosenberg

💻
bobgubko
bobgubko

💻
BaNgan
BaNgan

📖
Mahyar Pasarzangene
Mahyar Pasarzangene

📖
Tomáš Hübelbauer
Tomáš Hübelbauer

💻 📖
Jason Garber
Jason Garber

💻
Checkout Blocks
Checkout Blocks

💵
Adam Darrah
Adam Darrah

💵
Eleventy
Eleventy

💵
Nick Reilingh
Nick Reilingh

📖
Francisco Soto
Francisco Soto

💻
David LJ
David LJ

📖
Rasmus Wriedt Larsen
Rasmus Wriedt Larsen

📖
Bruno Carvalho
Bruno Carvalho

💻
傅鹏
傅鹏

💻
Joel Hamilton
Joel Hamilton

💻

Package Sidebar

Install

npm i liquidjs

Weekly Downloads

356,890

Version

10.10.1

License

MIT

Unpacked Size

1.3 MB

Total Files

150

Last publish

Collaborators

  • harttle