@eklingen/vinyl-stream-nunjucks

2.0.5 • Public • Published

Small vinyl-stream wrapper -aka Gulp plugin- for nunjucks

Run nunjucks within your streams.

TODO:

  • Write a more detailed readme
  • Include some common used template tag functions

NOTE: No tests have been written yet!

Installation

yarn install. Or npm install. Or just copy the files to your own project.

Usage

const nunjucksWrapper = require('@eklingen/vinyl-stream-nunjucks')
stream.pipe(nunjucksWrapper())

Options

Both the nunjucks option and the envOptions will be passe to nunjucks. See the "nunjucks" documentation for more information.

nunjucks

nunjucksWrapper({
  nunjucks: {
    path: '.',
    ext: '.html',
    data: {},
    manageEnv: null,
    loaders: []
  }
})

envOptions

nunjucksWrapper({
  envOptions: {
    autoescape: false,
    throwOnUndefined: true,
    trimBlocks: false,
    lstripBlocks: false,
    watch: false,
    noCache: false,
    useCache: true,
    async: false,
    express: null,
    tags: null
  }
})

Dependencies

This package requires "nunjucks" and "deepmerge".


Copyright (c) 2019 Elco Klingen. MIT License.

Package Sidebar

Install

npm i @eklingen/vinyl-stream-nunjucks

Weekly Downloads

15

Version

2.0.5

License

MIT

Unpacked Size

6.56 kB

Total Files

5

Last publish

Collaborators

  • eklingen