Socket
Socket
Sign inDemoInstall

consolidate

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

consolidate - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

6

History.md
0.2.0 / 2012-04-04
==================
* Added support for dust [fatjonny]
* Added handlebars support [jstewmon]
0.1.0 / 2012-01-03

@@ -3,0 +9,0 @@ ==================

45

lib/consolidate.js

@@ -27,3 +27,3 @@

exports.version = '0.1.0';
exports.version = '0.2.0';

@@ -86,2 +86,27 @@ /**

/**
* Dust support.
*/
exports.dust = function(path, options, fn){
var engine = requires.dust;
if (!engine) {
engine = requires.dust = require('dust');
engine.onLoad = function(path, callback) { read(path, options, callback); }
}
read(path, options, function(err, str) {
if (err) return fn(err);
try {
options.filename = path;
engine.renderSource(str, options, function(err, tmpl) {
fn(err, tmpl);
});
} catch (err) {
fn(err);
}
});
};
/**
* Swig support.

@@ -275,1 +300,19 @@ */

};
/**
* Handlebars support.
*/
exports.handlebars = function(path, options, fn) {
var engine = requires.handlebars || (requires.handlebars = require('handlebars'));
read(path, options, function(err, str){
if (err) return fn(err);
try {
options.filename = path;
var tmpl = engine.compile(str, options);
fn(null, tmpl(options));
} catch (err) {
fn(err);
}
});
}

4

package.json
{
"name": "consolidate"
, "version": "0.1.0"
, "version": "0.2.0"
, "description": "Template engine consolidation library"

@@ -23,2 +23,4 @@ , "keywords": ["template", "engine", "view"]

, "hogan.js": "*"
, "dust": "*"
, "handlebars": "*"
}

@@ -25,0 +27,0 @@ , "main": "index"

@@ -23,2 +23,4 @@ # Consolidate.js

- [hogan](https://github.com/twitter/hogan.js)
- [dust](https://github.com/akdubya/dustjs)
- [handlebars](https://github.com/wycats/handlebars.js/) [(website)](http://handlebarsjs.com/)

@@ -25,0 +27,0 @@ __NOTE__: you must still install the engines you wish to use, add them to your package.json dependencies.

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