Clock based event emitting.
This library was originally intended for other purposes but was deemed insufficient.
It isn't reliable enough for time-sensitive operations because it is merely built ontop of setTimeout.
It is still useful, however, for polling and other time independent applications.
var clock = require('clock');
clock.tock(function () {
console.log('tock');
});
clock.tick(1000);
// tock
// tock
// tock
// ... (every 1000ms)This library isn't available from the NPM repository or any other
package manager, but you can still add it to your package.json
{
"dependencies": {
"clock": "git://github.com/adlawson/clock.git#master"
}
}I accept contributions to the source via Pull Request, but you must run the tests and compile the JavaScript before it will be considered for merge. The source for this library is written in CoffeeScript, but it is distributed with the compiled JavaScript.
$ npm test # Run tests
$ npm run-script compile # Compile JavaScriptThe content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license at http://www.opensource.org/licenses/mit
