clockwise

1.0.0 • Public • Published

clockwise Build Status

A simple, configurable clock

Install

$ npm install --save clockwise

Usage

var Clock = require('clockwise')
var clock = new Clock()
clock.time() // => current time
 
clock.set(function timer () {
  return 1000
})
clock.time() // => time is 1000

API

new Clock()

Constructs a new clock instance that defaults to the normal clock

clock.time() -> Integer

Returns the current time

clock.set(timer) -> clock

timer

Required Type: function

The new function to use to generate the current time

clock.restore() -> clock

Restores the clock to the normal behavior

License

MIT © Ben Drucker

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i clockwise

    Weekly Downloads

    4

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • bendrucker