@hlobka/async-time-unit
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

async-time-unit

async-time-unit - is a simple lib with async time units and duration accessibility.

Installation:

As a dependency in your npm package:

  • npm install @hlobka/async-time-unit

Examples:

  • Awaiter in 10 seconds:
    • await promiseDelay(10, TimeUnit.sec);
    • await TimeUnit.sec.await(10)
    • await Duration.sec(10).await();
  • Awaiter till something happened:
    • Await in 1 minute till element appears with interval to check in 100 mls:
      • await promise.in(Duration.min(1)).tobe(() => document.getElementById("id") != null, Duration.mls(100))

Package Sidebar

Install

npm i @hlobka/async-time-unit

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

25.1 kB

Total Files

28

Last publish

Collaborators

  • hlobka