jstransformer-twig
Advanced tools
Comparing version 0.0.1 to 0.1.0
# Changelog | ||
## v0.1.0: 2015-08-29 | ||
- Add `options.filename` support | ||
## v0.0.1: 2015-07-22 | ||
- Initial release |
@@ -9,6 +9,14 @@ 'use strict'; | ||
exports.compile = function (str, options) { | ||
// Construct the Twig options. | ||
options = options || {} | ||
options.data = str | ||
if ('filename' in options && !('path' in options)) { | ||
options.path = options.filename | ||
} | ||
// Build the template. | ||
var template = twig(options) | ||
// Use .bind() so that the template is "this" when rendering. | ||
return template.render.bind(template) | ||
} |
{ | ||
"dependencies": { | ||
"twig": "^0.8.2" | ||
}, | ||
"name": "jstransformer-twig", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Twig.js support for JSTransformers.", | ||
@@ -26,6 +29,3 @@ "keywords": [ | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"twig": "^0.8.2" | ||
} | ||
"license": "MIT" | ||
} |
# jstransformer-twig | ||
[Twig.js](hhttps://github.com/justjohn/twig.js) support for [JSTransformers](http://github.com/jstransformers). | ||
[Twig.js](https://github.com/justjohn/twig.js) support for [JSTransformers](http://github.com/jstransformers). | ||
@@ -5,0 +5,0 @@ [![Build Status](https://img.shields.io/travis/jstransformers/jstransformer-twig/master.svg)](https://travis-ci.org/jstransformers/jstransformer-twig) |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3370
16
0