Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

middleware-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middleware-utils

Utils for Template middleware.

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
240
decreased by-86.6%
Maintainers
1
Weekly downloads
 
Created
Source

middleware-utils NPM version

Utils for Template middleware.

Install

Install with npm

$ npm i middleware-utils --save

Usage

var utils = require('middleware-utils');

API

.series

Run middleware in series

Params

  • fns {Array}: Array of middleware functions

Example

var middleware = require('./middleware/');

template.onLoad(/\.js$/, utils.series([
  middleware.foo,
  middleware.bar,
  middleware.baz,
]));

.parallel

Run middleware in parallel.

Params

  • fns {Array}: Array of middleware functions

Example

var middleware = require('./middleware/');

template.onLoad(/\.js$/, utils.parallel([
  middleware.foo,
  middleware.bar,
  middleware.baz,
]));

.error

Output a formatted middleware error.

Params

  • methodName {String}: The middleware method name (verb)

Example

template.postRender(/./, function (file, next) {
  // do stuff to file
  next();
}, utils.error('postRender'));

.handleError

Handle middleware errors for the .handle() method.

Params

  • file {Object}: Vinyl file object or template object.
  • methodName {String}: The middleware method name (verb)

Example

template.handle('onFoo', file, utils.handleError(file, 'onFoo'));
  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more
  • template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more
  • template-utils: Utils for Template, and Template-based applications.
  • utils: Fast, generic JavaScript/node.js utility functions.
  • verb: Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on June 13, 2015.

Keywords

FAQs

Package last updated on 13 Jun 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc