@openclaw/google-meet 2026.7.1 → 2026.7.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/{chrome-create-BhgM0jQO.js → chrome-create-DM1XJCOH.js} +87 -61
  2. package/dist/{cli-D364Yrym.js → cli-SodPSOFX.js} +47 -90
  3. package/dist/{config-DDYRr7-P.js → config-BeoHH_z5.js} +49 -13
  4. package/dist/{create-CkkaRlbI.js → create-CWcFI0ub.js} +2 -2
  5. package/dist/index.js +1235 -359
  6. package/dist/{oauth-75iPDzIn.js → oauth-DOfMKlGp.js} +3 -1
  7. package/node_modules/core-util-is/LICENSE +19 -0
  8. package/node_modules/core-util-is/README.md +3 -0
  9. package/node_modules/core-util-is/lib/util.js +107 -0
  10. package/node_modules/core-util-is/package.json +38 -0
  11. package/node_modules/immediate/LICENSE.txt +20 -0
  12. package/node_modules/immediate/README.md +93 -0
  13. package/node_modules/immediate/dist/immediate.js +75 -0
  14. package/node_modules/immediate/dist/immediate.min.js +1 -0
  15. package/node_modules/immediate/lib/browser.js +69 -0
  16. package/node_modules/immediate/lib/index.js +73 -0
  17. package/node_modules/immediate/package.json +42 -0
  18. package/node_modules/inherits/LICENSE +16 -0
  19. package/node_modules/inherits/README.md +42 -0
  20. package/node_modules/inherits/inherits.js +9 -0
  21. package/node_modules/inherits/inherits_browser.js +27 -0
  22. package/node_modules/inherits/package.json +29 -0
  23. package/node_modules/isarray/.npmignore +1 -0
  24. package/node_modules/isarray/.travis.yml +4 -0
  25. package/node_modules/isarray/Makefile +6 -0
  26. package/node_modules/isarray/README.md +60 -0
  27. package/node_modules/isarray/component.json +19 -0
  28. package/node_modules/isarray/index.js +5 -0
  29. package/node_modules/isarray/package.json +45 -0
  30. package/node_modules/isarray/test.js +20 -0
  31. package/node_modules/jszip/.codeclimate.yml +16 -0
  32. package/node_modules/jszip/.editorconfig +8 -0
  33. package/node_modules/jszip/.eslintrc.js +43 -0
  34. package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
  35. package/node_modules/jszip/.jekyll-metadata +0 -0
  36. package/node_modules/jszip/.travis.yml +17 -0
  37. package/node_modules/jszip/CHANGES.md +204 -0
  38. package/node_modules/jszip/LICENSE.markdown +651 -0
  39. package/node_modules/jszip/README.markdown +33 -0
  40. package/node_modules/jszip/deps.js +37 -0
  41. package/node_modules/jszip/dist/jszip.js +11577 -0
  42. package/node_modules/jszip/dist/jszip.min.js +13 -0
  43. package/node_modules/jszip/graph.svg +601 -0
  44. package/node_modules/jszip/index.d.ts +330 -0
  45. package/node_modules/jszip/lib/base64.js +106 -0
  46. package/node_modules/jszip/lib/compressedObject.js +74 -0
  47. package/node_modules/jszip/lib/compressions.js +14 -0
  48. package/node_modules/jszip/lib/crc32.js +77 -0
  49. package/node_modules/jszip/lib/defaults.js +11 -0
  50. package/node_modules/jszip/lib/external.js +18 -0
  51. package/node_modules/jszip/lib/flate.js +85 -0
  52. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  53. package/node_modules/jszip/lib/generate/index.js +57 -0
  54. package/node_modules/jszip/lib/index.js +55 -0
  55. package/node_modules/jszip/lib/license_header.js +11 -0
  56. package/node_modules/jszip/lib/load.js +88 -0
  57. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  58. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  59. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  60. package/node_modules/jszip/lib/object.js +384 -0
  61. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  62. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  63. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  64. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  65. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  66. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  67. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  68. package/node_modules/jszip/lib/signature.js +7 -0
  69. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  70. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  71. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  72. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  73. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  74. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  75. package/node_modules/jszip/lib/support.js +38 -0
  76. package/node_modules/jszip/lib/utf8.js +275 -0
  77. package/node_modules/jszip/lib/utils.js +501 -0
  78. package/node_modules/jszip/lib/zipEntries.js +261 -0
  79. package/node_modules/jszip/lib/zipEntry.js +293 -0
  80. package/node_modules/jszip/lib/zipObject.js +133 -0
  81. package/node_modules/jszip/package.json +67 -0
  82. package/node_modules/jszip/sponsors.md +21 -0
  83. package/node_modules/jszip/tsconfig.json +101 -0
  84. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  85. package/node_modules/lie/README.md +62 -0
  86. package/node_modules/lie/dist/lie.js +350 -0
  87. package/node_modules/lie/dist/lie.min.js +1 -0
  88. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  89. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  90. package/node_modules/lie/lib/browser.js +273 -0
  91. package/node_modules/lie/lib/index.js +298 -0
  92. package/node_modules/lie/license.md +7 -0
  93. package/node_modules/lie/lie.d.ts +244 -0
  94. package/node_modules/lie/package.json +69 -0
  95. package/node_modules/lie/polyfill.js +4 -0
  96. package/node_modules/pako/CHANGELOG.md +164 -0
  97. package/node_modules/pako/LICENSE +21 -0
  98. package/node_modules/pako/README.md +191 -0
  99. package/node_modules/pako/dist/pako.js +6818 -0
  100. package/node_modules/pako/dist/pako.min.js +1 -0
  101. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  102. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  103. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  104. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  105. package/node_modules/pako/index.js +14 -0
  106. package/node_modules/pako/lib/deflate.js +400 -0
  107. package/node_modules/pako/lib/inflate.js +423 -0
  108. package/node_modules/pako/lib/utils/common.js +105 -0
  109. package/node_modules/pako/lib/utils/strings.js +187 -0
  110. package/node_modules/pako/lib/zlib/README +59 -0
  111. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  112. package/node_modules/pako/lib/zlib/constants.js +68 -0
  113. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  114. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  115. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  116. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  117. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  118. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  119. package/node_modules/pako/lib/zlib/messages.js +32 -0
  120. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  121. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  122. package/node_modules/pako/package.json +44 -0
  123. package/node_modules/parse-ms/index.d.ts +30 -0
  124. package/node_modules/parse-ms/index.js +45 -0
  125. package/node_modules/parse-ms/license +9 -0
  126. package/node_modules/parse-ms/package.json +47 -0
  127. package/node_modules/parse-ms/readme.md +46 -0
  128. package/node_modules/pretty-ms/index.d.ts +157 -0
  129. package/node_modules/pretty-ms/index.js +149 -0
  130. package/node_modules/pretty-ms/license +9 -0
  131. package/node_modules/pretty-ms/package.json +55 -0
  132. package/node_modules/pretty-ms/readme.md +179 -0
  133. package/node_modules/process-nextick-args/index.js +45 -0
  134. package/node_modules/process-nextick-args/license.md +19 -0
  135. package/node_modules/process-nextick-args/package.json +25 -0
  136. package/node_modules/process-nextick-args/readme.md +18 -0
  137. package/node_modules/readable-stream/.travis.yml +34 -0
  138. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  139. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  140. package/node_modules/readable-stream/LICENSE +47 -0
  141. package/node_modules/readable-stream/README.md +58 -0
  142. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  143. package/node_modules/readable-stream/duplex-browser.js +1 -0
  144. package/node_modules/readable-stream/duplex.js +1 -0
  145. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  146. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  147. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  148. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  149. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  150. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  151. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  152. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  153. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  154. package/node_modules/readable-stream/package.json +52 -0
  155. package/node_modules/readable-stream/passthrough.js +1 -0
  156. package/node_modules/readable-stream/readable-browser.js +7 -0
  157. package/node_modules/readable-stream/readable.js +19 -0
  158. package/node_modules/readable-stream/transform.js +1 -0
  159. package/node_modules/readable-stream/writable-browser.js +1 -0
  160. package/node_modules/readable-stream/writable.js +8 -0
  161. package/node_modules/safe-buffer/LICENSE +21 -0
  162. package/node_modules/safe-buffer/README.md +584 -0
  163. package/node_modules/safe-buffer/index.d.ts +187 -0
  164. package/node_modules/safe-buffer/index.js +62 -0
  165. package/node_modules/safe-buffer/package.json +37 -0
  166. package/node_modules/{commander/LICENSE → setimmediate/LICENSE.txt} +8 -10
  167. package/node_modules/setimmediate/package.json +30 -0
  168. package/node_modules/setimmediate/setImmediate.js +186 -0
  169. package/node_modules/string_decoder/.travis.yml +50 -0
  170. package/node_modules/string_decoder/LICENSE +48 -0
  171. package/node_modules/string_decoder/README.md +47 -0
  172. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  173. package/node_modules/string_decoder/package.json +31 -0
  174. package/node_modules/util-deprecate/History.md +16 -0
  175. package/node_modules/util-deprecate/LICENSE +24 -0
  176. package/node_modules/util-deprecate/README.md +53 -0
  177. package/node_modules/util-deprecate/browser.js +67 -0
  178. package/node_modules/util-deprecate/node.js +6 -0
  179. package/node_modules/util-deprecate/package.json +27 -0
  180. package/npm-shrinkwrap.json +127 -9
  181. package/openclaw.plugin.json +1 -1
  182. package/package.json +8 -6
  183. package/node_modules/commander/Readme.md +0 -1172
  184. package/node_modules/commander/index.js +0 -21
  185. package/node_modules/commander/lib/argument.js +0 -147
  186. package/node_modules/commander/lib/command.js +0 -2790
  187. package/node_modules/commander/lib/error.js +0 -36
  188. package/node_modules/commander/lib/help.js +0 -731
  189. package/node_modules/commander/lib/option.js +0 -377
  190. package/node_modules/commander/lib/suggestSimilar.js +0 -99
  191. package/node_modules/commander/package-support.json +0 -19
  192. package/node_modules/commander/package.json +0 -64
  193. package/node_modules/commander/typings/index.d.ts +0 -1113
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
4
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
5
+ //
6
+ // This software is provided 'as-is', without any express or implied
7
+ // warranty. In no event will the authors be held liable for any damages
8
+ // arising from the use of this software.
9
+ //
10
+ // Permission is granted to anyone to use this software for any purpose,
11
+ // including commercial applications, and to alter it and redistribute it
12
+ // freely, subject to the following restrictions:
13
+ //
14
+ // 1. The origin of this software must not be misrepresented; you must not
15
+ // claim that you wrote the original software. If you use this software
16
+ // in a product, an acknowledgment in the product documentation would be
17
+ // appreciated but is not required.
18
+ // 2. Altered source versions must be plainly marked as such, and must not be
19
+ // misrepresented as being the original software.
20
+ // 3. This notice may not be removed or altered from any source distribution.
21
+
22
+ function ZStream() {
23
+ /* next input byte */
24
+ this.input = null; // JS specific, because we have no pointers
25
+ this.next_in = 0;
26
+ /* number of bytes available at input */
27
+ this.avail_in = 0;
28
+ /* total number of input bytes read so far */
29
+ this.total_in = 0;
30
+ /* next output byte should be put there */
31
+ this.output = null; // JS specific, because we have no pointers
32
+ this.next_out = 0;
33
+ /* remaining free space at output */
34
+ this.avail_out = 0;
35
+ /* total number of bytes output so far */
36
+ this.total_out = 0;
37
+ /* last error message, NULL if no error */
38
+ this.msg = ''/*Z_NULL*/;
39
+ /* not visible by applications */
40
+ this.state = null;
41
+ /* best guess about the data type: binary or text */
42
+ this.data_type = 2/*Z_UNKNOWN*/;
43
+ /* adler32 value of the uncompressed data */
44
+ this.adler = 0;
45
+ }
46
+
47
+ module.exports = ZStream;
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "pako",
3
+ "description": "zlib port to javascript - fast, modularized, with browser support",
4
+ "version": "1.0.11",
5
+ "keywords": [
6
+ "zlib",
7
+ "deflate",
8
+ "inflate",
9
+ "gzip"
10
+ ],
11
+ "homepage": "https://github.com/nodeca/pako",
12
+ "contributors": [
13
+ "Andrei Tuputcyn (https://github.com/andr83)",
14
+ "Vitaly Puzrin (https://github.com/puzrin)",
15
+ "Friedel Ziegelmayer (https://github.com/dignifiedquire)",
16
+ "Kirill Efimov (https://github.com/Kirill89)",
17
+ "Jean-loup Gailly",
18
+ "Mark Adler"
19
+ ],
20
+ "files": [
21
+ "index.js",
22
+ "dist/",
23
+ "lib/"
24
+ ],
25
+ "license": "(MIT AND Zlib)",
26
+ "repository": "nodeca/pako",
27
+ "scripts": {
28
+ "test": "make test"
29
+ },
30
+ "devDependencies": {
31
+ "ansi": "^0.3.1",
32
+ "benchmark": "^2.1.4",
33
+ "browserify": "^16.2.3",
34
+ "buffer-from": "^1.1.1",
35
+ "eslint": "^5.9.0",
36
+ "istanbul": "^0.4.5",
37
+ "mocha": "^5.2.0",
38
+ "multiparty": "^4.1.3",
39
+ "ndoc": "^5.0.1",
40
+ "uglify-js": "=3.4.8",
41
+ "zlibjs": "^0.3.1"
42
+ },
43
+ "dependencies": {}
44
+ }
@@ -0,0 +1,30 @@
1
+ export type TimeComponents<T extends (number | bigint) = number> = {
2
+ days: T;
3
+ hours: T;
4
+ minutes: T;
5
+ seconds: T;
6
+ milliseconds: T;
7
+ microseconds: T;
8
+ nanoseconds: T;
9
+ };
10
+
11
+ /**
12
+ Parse milliseconds into an object.
13
+
14
+ @example
15
+ ```
16
+ import parseMilliseconds from 'parse-ms';
17
+
18
+ parseMilliseconds(1337000001);
19
+ // {
20
+ // days: 15,
21
+ // hours: 11,
22
+ // minutes: 23,
23
+ // seconds: 20,
24
+ // milliseconds: 1,
25
+ // microseconds: 0,
26
+ // nanoseconds: 0
27
+ // }
28
+ ```
29
+ */
30
+ export default function parseMilliseconds<T extends number | bigint>(milliseconds: T): TimeComponents<T>;
@@ -0,0 +1,45 @@
1
+ const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;
2
+
3
+ function parseNumber(milliseconds) {
4
+ return {
5
+ days: Math.trunc(milliseconds / 86_400_000),
6
+ hours: Math.trunc(milliseconds / 3_600_000 % 24),
7
+ minutes: Math.trunc(milliseconds / 60_000 % 60),
8
+ seconds: Math.trunc(milliseconds / 1000 % 60),
9
+ milliseconds: Math.trunc(milliseconds % 1000),
10
+ microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),
11
+ nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),
12
+ };
13
+ }
14
+
15
+ function parseBigint(milliseconds) {
16
+ return {
17
+ days: milliseconds / 86_400_000n,
18
+ hours: milliseconds / 3_600_000n % 24n,
19
+ minutes: milliseconds / 60_000n % 60n,
20
+ seconds: milliseconds / 1000n % 60n,
21
+ milliseconds: milliseconds % 1000n,
22
+ microseconds: 0n,
23
+ nanoseconds: 0n,
24
+ };
25
+ }
26
+
27
+ export default function parseMilliseconds(milliseconds) {
28
+ switch (typeof milliseconds) {
29
+ case 'number': {
30
+ if (Number.isFinite(milliseconds)) {
31
+ return parseNumber(milliseconds);
32
+ }
33
+
34
+ break;
35
+ }
36
+
37
+ case 'bigint': {
38
+ return parseBigint(milliseconds);
39
+ }
40
+
41
+ // No default
42
+ }
43
+
44
+ throw new TypeError('Expected a finite number or bigint');
45
+ }
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "parse-ms",
3
+ "version": "4.0.0",
4
+ "description": "Parse milliseconds into an object",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/parse-ms",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "type": "module",
14
+ "exports": {
15
+ "types": "./index.d.ts",
16
+ "default": "./index.js"
17
+ },
18
+ "sideEffects": false,
19
+ "engines": {
20
+ "node": ">=18"
21
+ },
22
+ "scripts": {
23
+ "test": "xo && ava && tsd"
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts"
28
+ ],
29
+ "keywords": [
30
+ "browser",
31
+ "parse",
32
+ "time",
33
+ "ms",
34
+ "milliseconds",
35
+ "microseconds",
36
+ "nanoseconds",
37
+ "duration",
38
+ "period",
39
+ "range",
40
+ "interval"
41
+ ],
42
+ "devDependencies": {
43
+ "ava": "^6.0.1",
44
+ "tsd": "^0.30.3",
45
+ "xo": "^0.56.0"
46
+ }
47
+ }
@@ -0,0 +1,46 @@
1
+ # parse-ms
2
+
3
+ > Parse milliseconds into an object
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm install parse-ms
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import parseMilliseconds from 'parse-ms';
15
+
16
+ parseMilliseconds(1337000001);
17
+ /*
18
+ {
19
+ days: 15,
20
+ hours: 11,
21
+ minutes: 23,
22
+ seconds: 20,
23
+ milliseconds: 1,
24
+ microseconds: 0,
25
+ nanoseconds: 0
26
+ }
27
+ */
28
+
29
+ parseMilliseconds(1337000001n);
30
+ /*
31
+ {
32
+ days: 15n,
33
+ hours: 11n,
34
+ minutes: 23n,
35
+ seconds: 20n,
36
+ milliseconds: 1n,
37
+ microseconds: 0n,
38
+ nanoseconds: 0n
39
+ }
40
+ */
41
+ ```
42
+
43
+ ## Related
44
+
45
+ - [to-milliseconds](https://github.com/sindresorhus/to-milliseconds) - The inverse of this module
46
+ - [pretty-ms](https://github.com/sindresorhus/pretty-ms) - Convert milliseconds to a human readable string
@@ -0,0 +1,157 @@
1
+ export type Options = {
2
+ /**
3
+ Number of digits to appear after the seconds decimal point.
4
+
5
+ @default 1
6
+ */
7
+ readonly secondsDecimalDigits?: number;
8
+
9
+ /**
10
+ Number of digits to appear after the milliseconds decimal point.
11
+
12
+ Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime).
13
+
14
+ @default 0
15
+ */
16
+ readonly millisecondsDecimalDigits?: number;
17
+
18
+ /**
19
+ Keep milliseconds on whole seconds: `13s` → `13.0s`.
20
+
21
+ Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.
22
+
23
+ @default false
24
+ */
25
+ readonly keepDecimalsOnWholeSeconds?: boolean;
26
+
27
+ /**
28
+ Only show the first unit: `1h 10m` → `1h`.
29
+
30
+ Also ensures that `millisecondsDecimalDigits` and `secondsDecimalDigits` are both set to `0`.
31
+
32
+ @default false
33
+ */
34
+ readonly compact?: boolean;
35
+
36
+ /**
37
+ Number of units to show. Setting `compact` to `true` overrides this option.
38
+
39
+ @default Infinity
40
+ */
41
+ readonly unitCount?: number;
42
+
43
+ /**
44
+ Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds`.
45
+
46
+ @default false
47
+ */
48
+ readonly verbose?: boolean;
49
+
50
+ /**
51
+ Show milliseconds separately. This means they won't be included in the decimal part of the seconds.
52
+
53
+ @default false
54
+ */
55
+ readonly separateMilliseconds?: boolean;
56
+
57
+ /**
58
+ Show microseconds and nanoseconds.
59
+
60
+ @default false
61
+ */
62
+ readonly formatSubMilliseconds?: boolean;
63
+
64
+ /**
65
+ Display time using colon notation: `5h 1m 45s` → `5:01:45`. Always shows time in at least minutes: `1s` → `0:01`
66
+
67
+ Useful when you want to display time without the time units, similar to a digital watch.
68
+
69
+ Setting `colonNotation` to `true` overrides the following options to `false`:
70
+ - `compact`
71
+ - `formatSubMilliseconds`
72
+ - `separateMilliseconds`
73
+ - `verbose`
74
+
75
+ @default false
76
+ */
77
+ readonly colonNotation?: boolean;
78
+
79
+ /**
80
+ Hides the year and shows the hidden year additionally as days (365 per year): `1y 3d 5h 1m 45s` → `368d 5h 1m 45s`.
81
+
82
+ @default false
83
+ */
84
+ readonly hideYear?: boolean;
85
+
86
+ /**
87
+ Hides the year and days and shows the hidden values additionally as hours: `1y 3d 5h 1m 45s` → `8837h 1m 45s`.
88
+
89
+ @default false
90
+ */
91
+ readonly hideYearAndDays?: boolean;
92
+
93
+ /**
94
+ Hides the seconds: `1y 3d 5h 1m 45s` → `1y 3d 5h 1m`.
95
+
96
+ @default false
97
+ */
98
+ readonly hideSeconds?: boolean;
99
+
100
+ /**
101
+ Show sub-second values as decimal seconds: `900ms` → `0.9s`.
102
+
103
+ Useful for progress indicators where you want consistent unit format to prevent flickering.
104
+
105
+ @default false
106
+ */
107
+ readonly subSecondsAsDecimals?: boolean;
108
+ };
109
+
110
+ /**
111
+ Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`.
112
+
113
+ @param milliseconds - Milliseconds to humanize.
114
+
115
+ @example
116
+ ```
117
+ import prettyMilliseconds from 'pretty-ms';
118
+
119
+ prettyMilliseconds(1337000000);
120
+ //=> '15d 11h 23m 20s'
121
+
122
+ prettyMilliseconds(1337);
123
+ //=> '1.3s'
124
+
125
+ prettyMilliseconds(133);
126
+ //=> '133ms'
127
+
128
+ // `compact` option
129
+ prettyMilliseconds(1337, {compact: true});
130
+ //=> '1s'
131
+
132
+ // `verbose` option
133
+ prettyMilliseconds(1335669000, {verbose: true});
134
+ //=> '15 days 11 hours 1 minute 9 seconds'
135
+
136
+ // `colonNotation` option
137
+ prettyMilliseconds(95500, {colonNotation: true});
138
+ //=> '1:35.5'
139
+
140
+ // `formatSubMilliseconds` option
141
+ prettyMilliseconds(100.400080, {formatSubMilliseconds: true})
142
+ //=> '100ms 400µs 80ns'
143
+
144
+ // `subSecondsAsDecimals` option
145
+ prettyMilliseconds(900, {subSecondsAsDecimals: true});
146
+ //=> '0.9s'
147
+
148
+ // Can be useful for time durations
149
+ prettyMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5))
150
+ //=> '35m'
151
+ ```
152
+ */
153
+ export default function prettyMilliseconds(
154
+ milliseconds: number | bigint,
155
+ options?: Options
156
+ ): string;
157
+
@@ -0,0 +1,149 @@
1
+ import parseMilliseconds from 'parse-ms';
2
+
3
+ const isZero = value => value === 0 || value === 0n;
4
+ const pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;
5
+
6
+ const SECOND_ROUNDING_EPSILON = 0.000_000_1;
7
+ const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;
8
+
9
+ export default function prettyMilliseconds(milliseconds, options) {
10
+ const isBigInt = typeof milliseconds === 'bigint';
11
+ if (!isBigInt && !Number.isFinite(milliseconds)) {
12
+ throw new TypeError('Expected a finite number or bigint');
13
+ }
14
+
15
+ options = {...options};
16
+
17
+ const sign = milliseconds < 0 ? '-' : '';
18
+ milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; // Cannot use `Math.abs()` because of BigInt support.
19
+
20
+ if (options.colonNotation) {
21
+ options.compact = false;
22
+ options.formatSubMilliseconds = false;
23
+ options.separateMilliseconds = false;
24
+ options.verbose = false;
25
+ }
26
+
27
+ if (options.compact) {
28
+ options.unitCount = 1;
29
+ options.secondsDecimalDigits = 0;
30
+ options.millisecondsDecimalDigits = 0;
31
+ }
32
+
33
+ let result = [];
34
+
35
+ const floorDecimals = (value, decimalDigits) => {
36
+ const flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);
37
+ const flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);
38
+ return flooredValue.toFixed(decimalDigits);
39
+ };
40
+
41
+ const add = (value, long, short, valueString) => {
42
+ if (
43
+ (result.length === 0 || !options.colonNotation)
44
+ && isZero(value)
45
+ && !(options.colonNotation && short === 'm')) {
46
+ return;
47
+ }
48
+
49
+ valueString ??= String(value);
50
+ if (options.colonNotation) {
51
+ const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;
52
+ const minLength = result.length > 0 ? 2 : 1;
53
+ valueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;
54
+ } else {
55
+ valueString += options.verbose ? ' ' + pluralize(long, value) : short;
56
+ }
57
+
58
+ result.push(valueString);
59
+ };
60
+
61
+ const parsed = parseMilliseconds(milliseconds);
62
+ const days = BigInt(parsed.days);
63
+
64
+ if (options.hideYearAndDays) {
65
+ add((BigInt(days) * 24n) + BigInt(parsed.hours), 'hour', 'h');
66
+ } else {
67
+ if (options.hideYear) {
68
+ add(days, 'day', 'd');
69
+ } else {
70
+ add(days / 365n, 'year', 'y');
71
+ add(days % 365n, 'day', 'd');
72
+ }
73
+
74
+ add(Number(parsed.hours), 'hour', 'h');
75
+ }
76
+
77
+ add(Number(parsed.minutes), 'minute', 'm');
78
+
79
+ if (!options.hideSeconds) {
80
+ if (
81
+ options.separateMilliseconds
82
+ || options.formatSubMilliseconds
83
+ || (!options.colonNotation && milliseconds < 1000 && !options.subSecondsAsDecimals)
84
+ ) {
85
+ const seconds = Number(parsed.seconds);
86
+ const milliseconds = Number(parsed.milliseconds);
87
+ const microseconds = Number(parsed.microseconds);
88
+ const nanoseconds = Number(parsed.nanoseconds);
89
+
90
+ add(seconds, 'second', 's');
91
+
92
+ if (options.formatSubMilliseconds) {
93
+ add(milliseconds, 'millisecond', 'ms');
94
+ add(microseconds, 'microsecond', 'µs');
95
+ add(nanoseconds, 'nanosecond', 'ns');
96
+ } else {
97
+ const millisecondsAndBelow
98
+ = milliseconds
99
+ + (microseconds / 1000)
100
+ + (nanoseconds / 1e6);
101
+
102
+ const millisecondsDecimalDigits
103
+ = typeof options.millisecondsDecimalDigits === 'number'
104
+ ? options.millisecondsDecimalDigits
105
+ : 0;
106
+
107
+ const roundedMilliseconds = millisecondsAndBelow >= 1
108
+ ? Math.round(millisecondsAndBelow)
109
+ : Math.ceil(millisecondsAndBelow);
110
+
111
+ const millisecondsString = millisecondsDecimalDigits
112
+ ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)
113
+ : roundedMilliseconds;
114
+
115
+ add(
116
+ Number.parseFloat(millisecondsString),
117
+ 'millisecond',
118
+ 'ms',
119
+ millisecondsString,
120
+ );
121
+ }
122
+ } else {
123
+ const seconds = (
124
+ (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)
125
+ / 1000
126
+ ) % 60;
127
+ const secondsDecimalDigits
128
+ = typeof options.secondsDecimalDigits === 'number'
129
+ ? options.secondsDecimalDigits
130
+ : 1;
131
+ const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
132
+ const secondsString = options.keepDecimalsOnWholeSeconds
133
+ ? secondsFixed
134
+ : secondsFixed.replace(/\.0+$/, '');
135
+ add(Number.parseFloat(secondsString), 'second', 's', secondsString);
136
+ }
137
+ }
138
+
139
+ if (result.length === 0) {
140
+ return sign + '0' + (options.verbose ? ' milliseconds' : 'ms');
141
+ }
142
+
143
+ const separator = options.colonNotation ? ':' : ' ';
144
+ if (typeof options.unitCount === 'number') {
145
+ result = result.slice(0, Math.max(options.unitCount, 1));
146
+ }
147
+
148
+ return sign + result.join(separator);
149
+ }
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "pretty-ms",
3
+ "version": "9.3.0",
4
+ "description": "Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/pretty-ms",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "type": "module",
14
+ "exports": {
15
+ "types": "./index.d.ts",
16
+ "default": "./index.js"
17
+ },
18
+ "sideEffects": false,
19
+ "engines": {
20
+ "node": ">=18"
21
+ },
22
+ "scripts": {
23
+ "test": "xo && ava && tsd"
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts"
28
+ ],
29
+ "keywords": [
30
+ "pretty",
31
+ "prettify",
32
+ "human",
33
+ "humanize",
34
+ "humanized",
35
+ "readable",
36
+ "time",
37
+ "ms",
38
+ "milliseconds",
39
+ "duration",
40
+ "period",
41
+ "range",
42
+ "text",
43
+ "string",
44
+ "number",
45
+ "hrtime"
46
+ ],
47
+ "dependencies": {
48
+ "parse-ms": "^4.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "ava": "^6.2.0",
52
+ "tsd": "^0.31.2",
53
+ "xo": "^0.59.3"
54
+ }
55
+ }