gulp-ect

1.3.1 • Public • Published

gulp-ect

Gulp plugin to compile ect.js template engine

Install

Install with npm

npm install --save-dev gulp-ect

Example

js

var gulp = require('gulp');
var ect = require('ect');
 
gulp.task('ect', function(){
  gulp.src('./src/*.ect')
      .pipe(ect())
      .pipe(gulp.dest('./out'));
});
 
gulp.task('default', ['ect']);

coffee

ect = require('ect')
gulp.task 'ect'->
  gulp
    .src('./src/*.ect')
    .pipe(ect())
    .pipe gulp.dest('./out')
 
gulp.task 'default'['ect']

API

ect(options)

options.ext

Type: String
Default: .ect

The extensions input files.

options.outExt

Type: String
Default: .html

The extensions output files.

options.data

Type: Function or Object
Default: {}

The template context data.

If a function is passed, use the format function(fileName,callback) and fire callback as callback(data):

  gulp.src(['./src/*.ect', './src/inner/*.ect'])
    .pipe(ect({data: function (filename, cb) {
      cb({foo: "bar"});
    }}))
    .pipe(gulp.dest('./out'));

License

MIT © Vladislav Derjavin dev@vld.me

Package Sidebar

Install

npm i gulp-ect

Weekly Downloads

34

Version

1.3.1

License

MIT

Last publish

Collaborators

  • avevlad