node package manager


Make Middleware

Connect middleware to execute make(1) in the request / response cycle.

Useful during development as an alternative to watch(1). Removes the need to run a separate process.


You must provide the path to the Makefile you want to run

As a string:

var makeMiddleware = require('make-middleware')(__dirname)

As an object:

var makeMiddleware = require('make-middleware')({dirname: __dirname})

With an optional make target:

var makeMiddleware = require('make-middleware')({dirname: __dirname, target: 'fast'})


var express = require('express')
  , path = require('path')
  , makeMiddleware = require('make-middleware')({dirname: __dirname})
var app = express()
app.use(express.static(path.join(__dirname, 'public')));
app.configure('development', function(){