Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including mid with all npm packages installed. Try it out:

var mid = require("mid")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mid v0.0.1

=============================================================================== Mid.js ===============================================================================

Super simple middleware!

mid(stack, obj)

Create a new middleware, both the stack array and object to be mixed into are optional. Returns obj, or the exec function itself.

middleware.exec(args..., cb)

Call each function in the stack with the arguments. cb is called with no arguments when the stack finishes, or with an error when if/when one occurs.


Add fn to the middleware's stack.


The actual array of functions that the middleware uses as a stack, exposed in case you want to do something crazy and undocumented/untested.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free