Comparing version
@@ -9,3 +9,3 @@ 'use strict' | ||
module.exports = function (data, options, settings) { | ||
var gulpEjs = function (data, options, settings) { | ||
data = data || {} | ||
@@ -47,1 +47,5 @@ options = options || {} | ||
} | ||
gulpEjs.ejs = ejs | ||
module.exports = gulpEjs |
{ | ||
"name": "gulp-ejs", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "A plugin for Gulp that parses ejs template files", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"ejs": "2.5.6", | ||
"ejs": "2.5.7", | ||
"gulp-util": "3.0.8", | ||
@@ -35,4 +35,4 @@ "object-assign": "^4.1.0", | ||
"devDependencies": { | ||
"mocha": "3.1.2", | ||
"should": "11.2.1", | ||
"mocha": "4.0.1", | ||
"should": "13.1.3", | ||
"standard": "^10.0.0" | ||
@@ -39,0 +39,0 @@ }, |
# gulp-ejs [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
[](https://greenkeeper.io/) | ||
> ejs plugin for [gulp](https://github.com/wearefractal/gulp) | ||
@@ -39,2 +41,25 @@ | ||
If you want to specify the extension of output files, set the ext option: | ||
```javascript | ||
var ejs = require('gulp-ejs') | ||
gulp.src('./templates/*.ejs') | ||
.pipe(ejs({ | ||
msg: 'Hello Gulp!', | ||
ext: '.html' | ||
}) | ||
.pipe(gulp.dest('./dist')) | ||
``` | ||
### Acessing the ejs object | ||
The ejs object is also exported and you can use it to configure ejs: | ||
```javascript | ||
var gulpEjs = require('gulp-ejs') | ||
gulpEjs.ejs.fileLoader = function () { /* custom file loader */ } | ||
``` | ||
## API | ||
@@ -41,0 +66,0 @@ |
@@ -27,2 +27,6 @@ /* global describe, it */ | ||
it('should expose ejs global object', function () { | ||
ejs.ejs.should.be.type('object') | ||
}) | ||
it('should produce correct html output when rendering a file', function (done) { | ||
@@ -29,0 +33,0 @@ var srcFile = new gutil.File({ |
14824
4.73%247
2.07%111
29.07%18
-5.26%