@kikobeats/time-span
Advanced tools
Comparing version 0.0.1 to 1.0.1
module.exports = | ||
(start = process.hrtime.bigint()) => | ||
({ start = process.hrtime.bigint(), format = n => n } = {}) => | ||
() => | ||
Number(process.hrtime.bigint() - start) / 1e6 | ||
format(Number(process.hrtime.bigint() - start) / 1e6) |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/kikobeats/time-span", | ||
"version": "0.0.1", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
@@ -40,2 +40,4 @@ "author": { | ||
"@ksmithut/prettier-standard": "latest", | ||
"ava": "latest", | ||
"c8": "latest", | ||
"ci-publish": "latest", | ||
@@ -68,3 +70,3 @@ "conventional-github-releaser": "latest", | ||
"release:tags": "git push --follow-tags origin HEAD:master", | ||
"test": "exit 0", | ||
"test": "c8 ava", | ||
"update": "ncu -u", | ||
@@ -71,0 +73,0 @@ "update:check": "ncu -- --error-level 2" |
@@ -26,2 +26,10 @@ # time-span | ||
It also accepts a `format` function: | ||
```js | ||
const duration = timeSpan({ format: n => `${Math.round(n)}ms`}) | ||
await setTimeout(5000) | ||
console.log(duration()) // => 5000ms | ||
``` | ||
## License | ||
@@ -28,0 +36,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4867
0
40
14