gulp-edgejs

0.4.1 • Public • Published

gulp-edgejs

Edge.js(http://edge.adonisjs.com) template engine

npm npm

Install

yarn add gulp-edgejs

Usage

Basic

const gulp = require('gulp');
const gulpEdge = require('gulp-edgejs');
 
gulp.task('edge', ()=>{
  return gulp.src('./index.edge')
    .pipe( gulpEdge() )
    .pipe(gulp.dest('./build'));
});

Variable

<div>hello {{ name }}</div>
gulp.task('edge', ()=>{
  return gulp.src('./index.edge')
    .pipe( gulpEdge({ name: 'byungi' }) )
    .pipe(gulp.dest('./build'));
});

output:

<div>hello byungi</div>

API

gulpEdge([data[, options]])

Returns gulp transformer for edge.js compilation.

data

Set the data values.

object
gulp.src('./index.edge')
    .pipe( gulpEdge({ name: 'byungi' }) )
file
  return gulp.src('index.edge')
    .pipe( gulpEdge('./data.json') )
directory

If it is a directory, set the data that matches the edge.js file name in the directory.

  return gulp.src('edge/*.edge')
    .pipe( gulpEdge('data/') )

edge/main.edge

hello {{ value }}

data/main.js

export.value = 'world'

output:

hello world

options

ext

Output extension name. Default is html

views

Directory for load other view files. (edge.js can load other view files with @layout, @component keyword.)

path

An alias for views.

globals

Add global function or variable.

tags

Add custom tags.

refresh

If this value is true, import new data from the path without cache. This is useful when in watch mode. Default is false.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.1
    0
    • latest

Version History

Package Sidebar

Install

npm i gulp-edgejs

Weekly Downloads

2

Version

0.4.1

License

MIT

Unpacked Size

8.44 kB

Total Files

19

Last publish

Collaborators

  • skt-t1-byungi