A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.
Installations
npm install liquidjs
Developer
Developer Guide
Module System
CommonJS, UMD
Min. Node Version
>=14
Typescript Support
Yes
Node Version
14.21.3
NPM Version
8.19.4
Statistics
1,532 Stars
1,200 Commits
236 Forks
26 Watching
13 Branches
78 Contributors
Updated on 26 Nov 2024
Bundle Size
65.97 kB
Minified
19.31 kB
Minified + Gzipped
Languages
TypeScript (93.67%)
JavaScript (4.35%)
Liquid (0.93%)
Shell (0.69%)
Handlebars (0.35%)
HTML (0.01%)
Total Downloads
Cumulative downloads
Total Downloads
49,412,909
Last day
5.4%
97,877
Compared to previous day
Last week
3.1%
497,527
Compared to previous week
Last month
9.5%
2,109,435
Compared to previous month
Last year
52.7%
19,784,584
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
45
liquidjs
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.
- Documentation
- Please star LiquidJS on GitHub!
- Financial support via GitHub Sponsors.
What's it like?
Basically there're two types of Liquid syntax: tags enclosed by {% %}
and outputs enclosed by {{ }}
. A Liquid template looks like:
1{% if username %} 2 {{ username | append: ", welcome to LiquidJS!" | capitalize }} 3{% endif %}
A live demo is also available and here's a quick tutorial for Liquid syntax.
Installation
Install from npm in Node.js:
1npm install liquidjs
Or use the UMD bundle from jsDelivr:
1<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
Or render directly from CLI using npx:
1npx 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.
- WISMOlabs: Post Purchase Experience platform for eCommerce retailers enhancing customer satisfaction by using LiquidJS to provide customizable post-purchase experiences through programmable email, SMS, order tracking pages, and webhooks.
Feel free to create a PR or contact me to add your use case into this list!
Financial Support
If you personally love LiquidJS or it's benefiting your business, please consider financially support us via GitHub Sponsors. Special thanks to our sponsors!
Opensense | Eleventy | Peter deHaan | Touchless | Dropkiq | Dailycontributors | Serkan Holat |
amit777 | Khaled Salem | Sentry | Checkout Blocks | Customer IO | Emmanuel Cartelli | Microsoft |
PakStyle.pk | Syntax Podcast | Cartelli Emmanuel |
Contributors ✨
Want to contribute? see Contribution Guidelines. Thanks goes to these wonderful people:
Stable Version
The latest stable version of the package.
Stable Version
10.19.0
MODERATE
1
5.3/10
Summary
liquidjs may leak properties of a prototype
Affected Versions
< 10.0.0
Patched Versions
10.0.0
Reason
27 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:4
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/coverage.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/coverage.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/coverage.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/coverage.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/docs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/docs.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/docs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/docs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/lint.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/lint.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/lint.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/performance.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/performance.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/performance.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/performance.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/performance.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-check.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/pr-check.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/harttle/liquidjs/test.yml/master?enable=pin
- Info: 0 out of 28 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 third-party GitHubAction dependencies pinned
- Info: 7 out of 7 npmCommand dependencies pinned
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/build.yml:1
- Warn: no topLevel permission defined: .github/workflows/ci-build.yml:1
- Warn: no topLevel permission defined: .github/workflows/coverage.yml:1
- Warn: no topLevel permission defined: .github/workflows/docs.yml:1
- Warn: no topLevel permission defined: .github/workflows/lint.yml:1
- Warn: no topLevel permission defined: .github/workflows/performance.yml:1
- Warn: no topLevel permission defined: .github/workflows/pr-build.yml:1
- Warn: no topLevel permission defined: .github/workflows/pr-check.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
Project has not signed or included provenance with any releases.
Details
- Warn: release artifact v10.19.0 not signed: https://api.github.com/repos/harttle/liquidjs/releases/185811046
- Warn: release artifact v10.18.0 not signed: https://api.github.com/repos/harttle/liquidjs/releases/180242833
- Warn: release artifact v10.17.0 not signed: https://api.github.com/repos/harttle/liquidjs/releases/176280076
- Warn: release artifact v10.16.7 not signed: https://api.github.com/repos/harttle/liquidjs/releases/172613940
- Warn: release artifact v10.16.6 not signed: https://api.github.com/repos/harttle/liquidjs/releases/172480037
- Warn: release artifact v10.19.0 does not have provenance: https://api.github.com/repos/harttle/liquidjs/releases/185811046
- Warn: release artifact v10.18.0 does not have provenance: https://api.github.com/repos/harttle/liquidjs/releases/180242833
- Warn: release artifact v10.17.0 does not have provenance: https://api.github.com/repos/harttle/liquidjs/releases/176280076
- Warn: release artifact v10.16.7 does not have provenance: https://api.github.com/repos/harttle/liquidjs/releases/172613940
- Warn: release artifact v10.16.6 does not have provenance: https://api.github.com/repos/harttle/liquidjs/releases/172480037
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 18 are checked with a SAST tool
Reason
41 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-2rq5-699j-x7p6
- Warn: Project is vulnerable to: GHSA-c9f4-xj24-8jqx
- Warn: Project is vulnerable to: GHSA-jc84-3g44-wf2q
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-45rm-2893-5f49
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986 / GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-7wwv-vh3v-89cq
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-wx77-rp39-c6vg
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-x77j-w7wf-fjmw
- Warn: Project is vulnerable to: GHSA-3965-hpx2-q597
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4.6
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More