var im = require('istanbul-middleware'),
app.use(function (req, res, next) {
if (isJSRequiringCoverage(req)) {
var file = getFilePath(req), //it's ok
code = readTheCodeFromFile(file),//it's ok
instrumenter = im.getInstrumenter(); //TypeError: im.getInstrumenter is not a function
res.send(instrumenter.instrumentSync(code, file));
//exception handling omitted for brevity
} else {
next();
}
});
the getInstrumenter function is defined in './core.js',I can not use it on im
I write my own custom middleware.As in:
the getInstrumenter function is defined in './core.js',I can not use it on im