kahlil / gulp-scaffold

Use Gulp to scaffold all the things.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-scaffold

Use Gulp to scaffold things.

This is not a Gulp plugin, just an instruction and some examples on how to scaffold all the things with Gulp.

How To Scaffold All The Things

This very simple pattern parses cli options with @substack's optimist module and hands them right over to gulp-template as an object.

gulp.task('default', function () {
  gulp.src('some/template-file.xx')
    .pipe(template(require('optimist').argv))
    .pipe(gulp.dest('some/destination'));
});

Get Started

Clone this repo:

git clone http://github.com/distilledhype/gulp-scaffold

Then install all the dependencies with

npm install 

Now you can go ahead and scaffold READMEs:

// Scaffold a README.md.
// `gulp readme --headline="My Headline" --description="Some description."`
gulp.task('readme', function () {
  gulp.src('templates/README.md')
    .pipe(template(argv))
    .pipe(gulp.dest('results/readme'));
});

JavaScript modules:

// Scaffold a JavaScript module.
// `gulp module --name="moduleName"`
gulp.task('module', function() {
	gulp.src('templates/module.js')
		.pipe(template(argv))
		.pipe(gulp.dest('results/modules/' + argv.name.toLowerCase() + '.js'));
});

or anything you want, really. Roll your own and send a PR.
Would be cool to collect the templates and Gulpfile patterns here.

License

MIT © Kahlil Lechelt

About

Use Gulp to scaffold all the things.


Languages

Language:JavaScript 100.0%