A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/assemble/gulp-routes below:

doowb/gulp-routes: Add middleware to run for specified routes in your gulp pipeline.

Add middleware to run for specified routes in your gulp pipeline.

Install with npm:

$ npm install --save gulp-routes

The main export is a function that takes an instance of en-route and returns a gulp plugin function.

Params

Example

var routes = require('gulp-routes');
var Router = require('en-route').Router;
var router = new Router();

// define middleware
router.all(/\.hbs/, function (file, next) {
  var str = file.contents.toString();
  // do anything to `file` that can be done
  // in a gulp plugin
  file.contents = new Buffer(str);
  next();
});

// pass the router to `gulp-routes`
var route = routes(router);

gulp.src('*.hbs')
  .pipe(route())
  .pipe(gulp.dest('_gh_pages/'));

Create a router stream to run middleware for the specified method.

Params

Example

gulp.src('*.hbs')
  .pipe(route('before'))
  .pipe(otherPlugin())
  .pipe(route('after'))
  .pipe(gulp.dest('dist/'));

You might also be interested in these projects:

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Brian Woodward

Copyright © 2017, Brian Woodward. Released under the MIT License.

This file was generated by verb-generate-readme, v0.6.0, on August 07, 2017.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4