Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-ect with all npm packages installed. Try it out:

var gulpEct = require("gulp-ect")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-ect v1.3.1

Gulp plugin to compile ect.js template engine.

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

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free