1.0.0 • Published 8 years ago

gulp-perroquet v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

gulp-perroquet

Build Status

Install

$ npm install --save-dev gulp-perroquet

Usage

const gulp = require('gulp');
const perroquet = require('gulp-perroquet');

gulp.task('default', () => {
	gulp.src('src/app.html')
		.pipe(perroquet())
		.pipe(gulp.dest('dest/app.php'));
});

options

Custom function option

Use custom function like this:

perroquet({
	functions: {
		date: function (format) {
			// format = 'Y-m-d'
			return '<?php echo date(\''+format.replace(/'/g, '\\\'')+'\'); ?>';
		}
	}
});

Custom delimiter option

Use custom delimiter like this:

perroquet({
	regex: /<<(.*?)>>/g
});
// Match <<$variable>> tags instead of {{$variable}}

License

Apache 2.0 © Olivier blunt