Migrii/blanket — pull request #82 by morkai (2012-11-23 18:13:25+00:00)
Title: module.exports, Windows

Hello!

I've decided to play with Blanket after seeing it at [dailyjs.com](http://dailyjs.com/2012/11/23/blanket-xsduration-attr/), but couldn't run it on Windows (the instrumentation eval was throwing exceptions due to not escaped `\` characters - second commit should fix that).

First commit changes the `return exports;` in the instrumentation wrapper to `return module.exports;` so both methods can be used to export modules.

Thrid commit replaces two `replace()` calls with one and escapes the `.` at the end (I assumed you wanted to match the dot character used as in file paths and not ANY character). Fixes issues with require()'ing global modules.

Also, I've noticed in the instrumented code that the line to count map starts from `1`, but later it's incremented starting from `0`.

Also, comments and empty lines are not skipped and multiline literals are not counted as a single line. Compare [this](http://lukasz.walukiewicz.eu/dev/pubsub-coverage/blanket.html) (created using Blanket) to [this](http://lukasz.walukiewicz.eu/dev/pubsub-coverage/istanbul/lib/MessageBroker.js.html) (created using Istanbul).