Skip to content

mk-pmb/hrtmo1807-pmb-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

hrtmo1807-pmb

Human-readable timeouts (callback-timeout-flexible + timestring-notsep)

API

This module exports one function:

hrtmo(opts)

opts is an options object that supports these keys:

  • limit (required): Either false to immediately return false, or a timespan (as string).
  • cb: Your callback, for delivery of the TimeoutError if triggered.
  • all other options supported by callback-timeout-flexible that aren't about timespans.

Quick recap from CTF

The result is not an opaque timer ID or timer object, but instead a callback function that can be used to decide the outcome early.

cb will carry a timeout property that holds the timeout control object (TCO), which in turn has methods like .renew() and .abandon().

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

Human-readable timeouts (callback-timeout-flexible + timestring-notsep)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published