From 2ab8ed6d70de1da01398335378e629398bc101e5 Mon Sep 17 00:00:00 2001 From: Brandon Pittman Date: Mon, 11 Nov 2019 22:37:53 +0900 Subject: [PATCH] Add example using context with CLI. --- Home.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Home.md b/Home.md index ae8ab02..9fa702e 100644 --- a/Home.md +++ b/Home.md @@ -30,6 +30,12 @@ Also available from CLI: echo '{{"hello" | capitalize}}' | npx liquidjs ``` +If you pass a path to a JSON file or a JSON string as the first argument, it will be used as the context for your template. + +```bash +echo 'Hello, {{ name }}.' | npx liquidjs '{"name": "Snake"}' +``` + ## More Demos There's [a live demo][jsfiddle] on JSFiddle, and a list of demo projects in [the demo/ directory][demo-dir]