This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -1,23 +1,25 @@
# browser-process-hrtime
Browser shim for Node.js process.hrtime().
Browser shim for Node.js `process.hrtime()`.
See [documentation at nodejs.org](http://nodejs.org/api/process.html#process_process_hrtime)
This module does not provide the same level of time precision as node.js, but provides a matching API and response format.
### usage
Use hrtime independant of environment (node or browser).
It will use process.hrtime first and fallback if not present.
Use hrtime independent of environment (node or browser).
It will use `process.hrtime` first and fallback if not present.
```js
var hrtime = require('browser-process-hrtime')
var start = hrtime()
const hrtime = require('browser-process-hrtime')
const start = hrtime()
// ...
var delta = hrtime(start)
const delta = hrtime(start)
```
### monkey-patching
You can monkey-patch process.hrtime for your dependency graph like this:
You can monkey-patch `process.hrtime` for your dependency graph like this:
```js
process.hrtime = require('browser-process-hrtime')
var coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths')
const coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths')
```
### note

4
node_modules/browser-process-hrtime/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
declare module "browser-process-hrtime" {
function hrtime(time?: [number, number]): [number, number];
export = hrtime;
}

View File

@@ -1,39 +1,35 @@
{
"_args": [
[
"browser-process-hrtime@0.1.3",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "browser-process-hrtime@0.1.3",
"_id": "browser-process-hrtime@0.1.3",
"_from": "browser-process-hrtime@^1.0.0",
"_id": "browser-process-hrtime@1.0.0",
"_inBundle": false,
"_integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==",
"_integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==",
"_location": "/browser-process-hrtime",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "browser-process-hrtime@0.1.3",
"raw": "browser-process-hrtime@^1.0.0",
"name": "browser-process-hrtime",
"escapedName": "browser-process-hrtime",
"rawSpec": "0.1.3",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "0.1.3"
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/w3c-hr-time"
],
"_resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz",
"_spec": "0.1.3",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
"_shasum": "3c9b4b7d782c8121e56f10106d84c0d0ffc94626",
"_spec": "browser-process-hrtime@^1.0.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/w3c-hr-time",
"author": {
"name": "kumavis"
},
"bugs": {
"url": "https://github.com/kumavis/browser-process-hrtime/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Shim for process.hrtime in the browser",
"homepage": "https://github.com/kumavis/browser-process-hrtime#readme",
"license": "BSD-2-Clause",
@@ -46,5 +42,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.3"
"version": "1.0.0"
}