Socket
Socket
Sign inDemoInstall

watchdog

Package Overview
Dependencies
2
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    watchdog

An Timer used to Detect and Recover from Malfunctions


Version published
Weekly downloads
1.5K
increased by2.42%
Maintainers
1
Install size
215 kB
Created
Weekly downloads
 

Readme

Source

WATCHDOG

NPM Version Build Status Downloads Powered by TypeScript Greenkeeper badge

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

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> (http://linkedin.com/in/zixia)

profile for zixia at Stack Overflow, Q&A for professional and enthusiast programmers
  • Code & Docs © 2017 Huan LI <zixia@zixia.net>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

Keywords

FAQs

Last updated on 27 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc