@abtnode/util

1.16.26 • Public • Published

ArcBlock's JavaScript utility

Usage

For example:

const tryWithTimeout = require('@abtnode/util/lib/try-with-timeout');
try {
  await tryWithTimeout(() => new Promise((resolve) => setTimeout(() => resolve(true), 60)), 50);
} catch (err) {
  expect(err).toBeTruthy();
  expect(err.message).toContain('Operation timed out after 50 ms');
}

Readme

Keywords

none

Package Sidebar

Install

npm i @abtnode/util

Weekly Downloads

574

Version

1.16.26

License

Apache-2.0

Unpacked Size

77.2 kB

Total Files

64

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a