JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15859
  • Score
    100M100P100Q122211F
  • License MIT

Compile Lodash templates. Underscore too.

Package Exports

  • gulp-template

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-template) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-template Build Status

Compile Lo-Dash templates

Lo-Dash is like Underscore, but faster and better.

Issues with the output should be reported on the Lo-Dash issue tracker.

Install

$ npm install --save-dev gulp-template

Usage

src/greeting.html

<h1>Hello <%= name %></h1>

gulpfile.js

var gulp = require('gulp');
var template = require('gulp-template');

gulp.task('default', function () {
    return gulp.src('src/greeting.html')
        .pipe(template({name: 'Sindre'}))
        .pipe(gulp.dest('dist'));
});

dist/greeting.html

<h1>Hello Sindre</h1>

API

See the Lo-Dash _.template docs.

template(data, options)

data

Type: Object

The data object used to populate the text.

options

Type: Object

Lo-Dash _.template options.

Notes

If you use grunt instead of gulp, but want to perform a similar task, use grunt-template.

License

MIT © Sindre Sorhus