Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-ejs

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ejs

A plugin for Gulp that parses ejs template files

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.7K
decreased by-9.17%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-ejs NPM version Build Status Dependency Status

ejs plugin for gulp

Usage

First, install gulp-ejs as a development dependency:

npm install --save-dev gulp-ejs

Then, add it to your gulpfile.js:

var ejs = require("gulp-ejs");

gulp.src("./templates/*.ejs")
	.pipe(ejs({
		msg: "Hello Gulp!"
	}))
	.pipe(gulp.dest("./dist"));

If you want to use gulp-ejs in a watch/livereload task, you may want to avoid gulp exiting on error when, for instance, a partial file is ENOENT. Here's an example on how to make it work:

var ejs = require('gulp-ejs');
var gutil = require('gulp-util');

gulp.src('./templates/*.ejs')
	.pipe(ejs({
		msg: 'Hello Gulp!'
	}).on('error', gutil.log))
	.pipe(gulp.dest('./dist'));

This will make gulp log the error and continue normal execution.

API

ejs(options, settings)

options

Type: hash Default: {}

A hash object where each key corresponds to a variable in your template. Also you can set ejs options in this hash.

For more info on ejs options, check the project's documentation.

settings

Type: hash Default: {ext: '.html'}

A hash object to configure the plugin.

settings.ext

Type: String Default: .html

Defines the default file extension that will be appended to the filename.

License

MIT License

Keywords

FAQs

Package last updated on 24 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc