make-middleware

middleware to execute a makefile

npm install make-middleware
1 downloads in the last week
4 downloads in the last month

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.

Usage

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'})

Example

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(){
  app.use(makeMiddleware);
});
npm loves you