File tree 4 files changed +44
-0
lines changed
4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,12 @@ engine
98
98
.then (console .log ) // outputs "Alice"
99
99
```
100
100
101
+ Or from the CLI:
102
+
103
+ ``` bash
104
+ echo ' {{ "hello" | capitalize }}' | liquidjs
105
+ ```
106
+
101
107
## Use with Express.js
102
108
103
109
``` javascript
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : [" standard" ],
3
+ "env" : {
4
+ "mocha" : true ,
5
+ "es6" : true ,
6
+ "browser" : true ,
7
+ "node" : true
8
+ },
9
+ "plugins" : [
10
+ " mocha" ,
11
+ " standard" ,
12
+ " promise"
13
+ ],
14
+ "rules" : {
15
+ "no-var" : 2 ,
16
+ "prefer-const" : 2 ,
17
+ "@typescript-eslint/no-var-requires" : " off" ,
18
+ "no-unused-vars" : " off" ,
19
+ "indent" : " off"
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ const Liquid = require ( '..' )
4
+
5
+ let tpl = ''
6
+ process . stdin . on ( 'data' , chunk => ( tpl += chunk ) )
7
+ process . stdin . on ( 'end' , ( ) => render ( tpl ) )
8
+
9
+ async function render ( tpl ) {
10
+ const liquid = new Liquid ( )
11
+ const html = await liquid . parseAndRender ( tpl )
12
+ console . log ( html )
13
+ }
Original file line number Diff line number Diff line change 17
17
"build" : " rollup -c rollup.config.ts && ls -lh dist" ,
18
18
"version" : " npm run build"
19
19
},
20
+ "bin" : {
21
+ "liquidjs" : " ./bin/liquid.js" ,
22
+ "liquid" : " ./bin/liquid.js"
23
+ },
20
24
"repository" : {
21
25
"type" : " git" ,
22
26
"url" : " git+https://github.com/harttle/liquidjs.git"
You can’t perform that action at this time.
0 commit comments