Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gulp-tpl2json

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-tpl2json

Make template files into JSON

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

gulp-tpl2json

Make template files into JSON

Install

$ npm install --save-dev gulp-tpl2json

Usage

src/test1.tpl

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

src/test2.tpl

<header>template <%= path %></header>

gulpfile.js

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

gulp.task('default', function () {
	return gulp.src('src/greeting.html')
		.pipe(tpl2json('template.js'/*, {newLine:'\n', expression:'var a = '}*/))
		.pipe(gulp.dest('dist'));
});

dist/template.js

{"test1.tpl":"<h1>Hello Sindre</h1>","test2.tpl":"<header>template <%= path %></header>"}

Notes

License

MIT

Keywords

template

FAQs

Package last updated on 10 Sep 2016

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