@zenweb/template-nunjucks
v4.0.0
Published
zenweb template engine - nunjucks
Downloads
45
Readme
zenweb template engine - nunjucks
zenweb template engine - nunjucks
Install
yarn add @zenweb/template @zenweb/template-nunjucks
App Config
src/index.ts
import { create } from 'zenweb';
import modTemplate from '@zenweb/template';
import nunjucks from '@zenweb/template-nunjucks';
create()
.setup(modTemplate({
engine: nunjucks(),
}))
.start();
Add Filters
assign
{% set aobj = { a: 1, b: 2, c: 3 } %}
{{aobj|assign({ b: 100, c: undefined })}}
{ a: 1, b: 100 }
isarray
{% set aobj = [] %}
{{aobj|isarray}}
true