New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fly-nunjucks-render

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fly-nunjucks-render

Render Nunjucks templates with Fly!

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

fly-nunjucks-render

Render Nunjucks templates with Fly.

Issues with the output should be reported on the Nunjucks issue tracker.

Install

npm install --save-dev fly-nunjucks-render

Usage

exports.views = function * (fly) {
  yield fly.source('src/*.html')
    .nunjucks({
      base: 'src/partials',
      data: {name: 'Luke Edwards'},
      // or
      dataPath: 'src/path/to/data.json'
    })
    .target('dist');
}
<!-- src/index.html -->
<p>Hello, {{ name }}!</p>

API

.nunjucks(options)

Multiple configuration options for Nunjucks are available.

Important: Please do not attempt to use the watch option. Instead, use fly.watch().

See below for additional options specific to fly-nunjucks-render.

options.base

Type: string
Default: .

Specify the location of your templates. Without this, Nunjucks will not be able to reliably compile or find your partials.

options.data

Type: object
Default: {}

Context data that is passed to your templates. Optional

option.dataPath

Type: string
Default: ''

Similar to options.data, but is a path to an external file. Useful for large datasets. Optional

License

MIT © Luke Edwards

Keywords

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc