@glennjones/nunjucks-tools

0.0.2 • Public • Published

Nunjucks Tools

A set of simple tools build to help convert other templates types into nunjucks

Installation

npm i nunjucks-tools

Usage

const Nunjucks = require('nunjucks');
const NunjucksTools = require('nunjucks-tools');
const env = new Nunjucks.Environment();

env.addExtension('with', new NunjucksTools.with(env));
env.addExtension('withInclude', new NunjucksTools.withInclude(env));

with

{% with obj.size, as='image' %}
   with: {{ image.width }}
{% endwith %}

includeWith

{% includeWith "template.njk", with={
    x: 5,
    y: 4
} %}

Issues

If you find any issue please file here on github and I will try and fix them.

Readme

Keywords

Package Sidebar

Install

npm i @glennjones/nunjucks-tools

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

2.68 kB

Total Files

5

Last publish

Collaborators

  • glennjones