Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

multiplex-templates

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiplex-templates - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

lib/template.js

10

lib/engines.js
'use strict';
var _ = require('lodash'),
template = require('./template'),
engines = {},

@@ -18,3 +19,3 @@ supported = ['nunjucks', 'jade'];

// add embed filters and mixins
engines.nunjucks.addFilter('embed', require('./nunjucks').embedFilter);
engines.nunjucks.addFilter('embed', template.embed);

@@ -30,3 +31,8 @@ module.exports = {

jade: {
render: engines.jade.renderFile.bind(engines.jade)
render: function (file, options) {
options = options || {};
// add embed to the locals
options.embed = template.embed;
return engines.jade.renderFile(file, options);
}
}

@@ -33,0 +39,0 @@ };

2

package.json
{
"name": "multiplex-templates",
"version": "0.3.0",
"version": "0.4.0",
"description": "Easy embedding for multiple template languages",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -95,2 +95,19 @@ # multiplex-templates

### Jade
Jade embedding is very similar. Multiplex-templates adds an `embed` function to the options passed into any jade template, which has the same logic as the nunjucks filter.
```jade
section#foo
p.embedded
!= embed(data, 'name')
```
As with the nunjucks template, you can also pass a `defaults` object into it as a third argument.
```jade
section#foo
p.embedded
!= embed(data, 'name', defaults)
```
## Tests

@@ -97,0 +114,0 @@

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