MCPcopy
hub / github.com/harttle/liquidjs

github.com/harttle/liquidjs @v10.27.1 sqlite

repository ↗ · DeepWiki ↗ · release v10.27.1 ↗
939 symbols 2,487 edges 264 files 24 documented · 3%
README

LiquidJS

A simple, expressive, extensible Liquid template engine for JavaScript — Shopify, Jekyll and GitHub Pages compatible, for Node.js, browsers, and the CLI, with TypeScript support.

npm version npm downloads Build Status Coverage License: MIT

[Documentation][doc] · Playground · [Setup guide][setup] · [Contributing][contribution]

LiquidJS playground: edit a template and context, see live HTML output

Try the online playground.

Quick start

import { Liquid } from 'liquidjs'

const engine = new Liquid()
const html = await engine.parseAndRender(
  'Hello, {{ name | capitalize }}!',
  { name: 'liquid' }
)
//=> 'Hello, Liquid!'

Installation

Node.js

npm install liquidjs

Browser (jsDelivr UMD bundle)

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

CLI

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

See the [setup guide][setup] for partials, layouts, caching, and other options.

Used by

Eleventy Opensense Power Pages, Azure API Management developer portal GitHub Docs Kibana Shopify CLI, Checkout Blocks Customer IO

Syntax Podcast TestMu AI Chudovo PakStyle.pk EscortA.com Touchless

Dropkiq Directus Builder.io, Mitosis Pattern Lab Rock RMS WISMOlabs Freshet

Products and projects running on LiquidJS. Open a PR to add yours.

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!

Eleventy Opensense Inc. Microsoft Sentry Checkout Blocks Customer IO Syntax Podcast

TestMu AI Tal Chudovo Dailycontributors PakStyle.pk EscortA.com

Touchless Dropkiq Peter deHaan Serkan Holat amit777 Khaled Salem Emmanuel Cartelli <img src="https://images.opencollective.com/cartelli-emmanuel/avatar

Extension points exported contracts — how you extend this code

Emitter (Interface)
(no doc) [7 implementers]
src/emitters/emitter.ts
Comparable (Interface)
(no doc) [2 implementers]
src/drop/comparable.ts
Template (Interface)
(no doc) [2 implementers]
src/template/template.ts
Cache (Interface)
(no doc) [1 implementers]
src/cache/cache.ts
FileDescriptor (Interface)
(no doc)
test/stub/mockfs.ts
LiquidOptions (Interface)
(no doc)
src/liquid-options.ts
ScopeObject (Interface)
(no doc)
src/context/scope.ts
FS (Interface)
(no doc)
src/fs/fs.ts

Core symbols most depended-on inside this repo

parseAndRender
called by 439
src/liquid.ts
mock
called by 136
test/stub/mockfs.ts
renderFile
called by 136
src/liquid.ts
parseAndRenderSync
called by 135
src/liquid.ts
parse
called by 134
src/liquid.ts
toPromise
called by 104
src/util/async.ts
analyzeSync
called by 73
src/template/analysis.ts
stringify
called by 72
src/util/underscore.ts

Shape

Method 386
Function 313
Class 210
Interface 26
Enum 4

Languages

TypeScript100%

Modules by API surface

src/parser/tokenizer.ts48 symbols
src/liquid.ts43 symbols
src/template/analysis.ts38 symbols
src/util/underscore.ts33 symbols
src/filters/array.ts32 symbols
src/util/error.ts29 symbols
src/util/liquid-date.ts24 symbols
src/context/context.ts23 symbols
test/integration/drop/drop.spec.ts22 symbols
src/filters/string.ts21 symbols
docs/themes/navy/source/js/main.js18 symbols
test/e2e/issues.spec.ts17 symbols

Dependencies from manifests, versioned

@babel/core7.13.14 · 1×
@babel/plugin-proposal-private-property-in-object7.21.11 · 1×
@babel/preset-env7.13.12 · 1×
@babel/preset-react7.13.13 · 1×
@commitlint/cli12.1.4 · 1×
@commitlint/config-conventional8.2.0 · 1×
@semantic-release/changelog6.0.2 · 1×
@semantic-release/commit-analyzer9.0.2 · 1×
@semantic-release/git10.0.1 · 1×
@semantic-release/npm13.1.5 · 1×
@semantic-release/release-notes-generator10.0.3 · 1×
@testing-library/react16.0.0 · 1×

For agents

$ claude mcp add liquidjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact