Socket
Socket
Sign inDemoInstall

nunjucks-filters

Package Overview
Dependencies
Maintainers
9
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nunjucks-filters

Useful nunjucks filters


Version published
Maintainers
9
Created
Source

nunjucks-filters

Build Status Code Climate

Nunjucks environment and filters

Installation

npm install --save nunjucks-filters

Usage

Simply require it in your app.js file

var app = require('express')(),
  nunjucks = require('nunjucks-filters')();

app.engine('nunjucks', nunjucks);

Passing env in

If you want to configure and use your own nunjucks environment, you can pass it through

var nunjucks = require('nunjucks'),
  env = nunjucks.configure('.', { custom: 'options' }),
  filters = require('nunjucks-filters');

filters(env);

Getting env out

Nunjucks-filters returns its nunjucks environment (including any env passed into it), so you can easily add your own filters and globals.

var env = require('nunjucks-filters')();

// add a filter
env.addFilter('emoji', function () {
  return '(⌐■_■)';
});

// add a global
env.addGlobal('coolDude', 'Nelson Pecora');

Keywords

FAQs

Package last updated on 15 Sep 2016

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