Skip to content

huan/watchdog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2b7b371 · Oct 14, 2021
Oct 14, 2021
Oct 8, 2017
Oct 13, 2017
Oct 10, 2021
Oct 10, 2021
Oct 10, 2021
Oct 10, 2021
Oct 8, 2017
Oct 10, 2021
Oct 8, 2017
Jan 29, 2020
Oct 9, 2017
Oct 10, 2021
Oct 10, 2021
Dec 29, 2019
Oct 10, 2021
Oct 10, 2021

Repository files navigation

WATCHDOG

NPM NPM Version Downloads Powered by TypeScript ES Modules

A Timer used to Detect and Recover from Malfunctions.

watchdog

Picture Credit: Using Watchdog Timer

USAGE

$ npm install watchdog
...
import { Watchdog } from 'watchdog'

const TIMEOUT = 1 * 1000  // 1 second
const dog = new watchdog(TIMEOUT)

const food = { data: 'delicious' }

dog.on('reset', () => console.log('reset-ed'))
dog.on('feed',  () => console.log('feed-ed'))

dog.feed(food)
// Output: feed-ed

setTimeout(function() {
  dog.sleep()
  console.log('dog sleep-ed. Demo over.')
}, TIMEOUT + 1)
// Output: reset-ed.
// Output: dog sleep-ed. Demo over.

DOCUMENT

See auto generated docs

HISTORY

master

In developing ...

v0.8 Jul 2018

  • Support browser (#31)

v0.0.1 Oct 2017

  • Init watchdog

SEE ALSO

THANKS

Thanks to Damon Oehlman (https://github.com/DamonOehlman) who owned the watchdog name of NPM module. He is so kind and nice that passed this name over to me after my request.

AUTHOR

Huan LI (李卓桓) zixia@zixia.net

Profile of Huan LI (李卓桓) on StackOverflow

COPYRIGHT & LICENSE

  • Code & Docs © 2017-now Huan LI <zixia@zixia.net>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons