Examples are tests!
Imagine we are writing tests/examples for ready-signal
var Signal =log = __filename/*Signal gives you a signal function.*/// "function"/*You can attach a listener to signalAnd it will be called*/var r =/*It also calls your listener if you add itafter the signal is ready*/var r =/*Multiple callbacks will also fire!*/var r =
Now just run
node file.js and it should print
1 function2 true3 true4 true5 true
What it's doing is matching every log call with the value descriped in the comment below it. That's it.
This is your test, example and documentation
npm install doc-test -g
doc-test <relative folder>
This will basically just run node on every file.
npm install doc-test