gulp-perroquet
v1.0.0
Published
Compile perroquet template files into pure PHP files
Downloads
3
Readme
gulp-perroquet
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