@abtnode/util
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "ArcBlock's JavaScript utility", | ||
@@ -34,3 +34,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "4a66e35b4cdf5512276b50c28535f352508ae0ac" | ||
"gitHead": "d9c5f53b8cf37a9b43da2952acaa544f6b7101eb" | ||
} |
@@ -18,3 +18,3 @@ # ArcBlock's JavaScript utility | ||
```js | ||
const getBlockletMeta = require('@abtnode/util/lib/read_blocklet_config') | ||
const getBlockletMeta = require('@abtnode/util/lib/read_blocklet_config'); | ||
const meta = getBlockletMeta(blockletDir); | ||
@@ -28,1 +28,11 @@ ``` | ||
### TryWithTimeout | ||
```js | ||
const { tryWithTimeout } = require('@abtnode/util'); | ||
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'); | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9422
37