Node's Play Mate

    @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.

    Keywords

    Install

    npm i @glennjones/nunjucks-tools

    DownloadsWeekly Downloads

    7

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    2.68 kB

    Total Files

    5

    Last publish

    Collaborators

    • glennjones