@abtnode/util

1.16.24 • 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

1,792

Version

1.16.24

License

Apache-2.0

Unpacked Size

73.3 kB

Total Files

63

Last publish

Collaborators

  • wangshijun
  • polunzh
  • mave99a