@dotpi/tools 2.12.3 → 2.13.0

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 (121) hide show
  1. package/dotpi-tools.js +12 -3
  2. package/dotpi_root/bin/dotpi_prepare_system +35 -16
  3. package/dotpi_root/dist/@dotpi/javascript/LICENSE +28 -0
  4. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/arguments/shell.js +11 -0
  5. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/methods/main-async.js +2 -1
  6. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/lib/methods/main-sync.js +2 -1
  7. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/package.json +13 -12
  8. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/readme.md +22 -12
  9. package/dotpi_root/dist/@dotpi/javascript/node_modules/execa/types/verbose.d.ts +1 -1
  10. package/dotpi_root/dist/@dotpi/javascript/package.json +4 -3
  11. package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/arguments/shell.js +11 -0
  12. package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/methods/main-async.js +2 -1
  13. package/dotpi_root/dist/@dotpi/module/node_modules/execa/lib/methods/main-sync.js +2 -1
  14. package/dotpi_root/dist/@dotpi/module/node_modules/execa/package.json +13 -12
  15. package/dotpi_root/dist/@dotpi/module/node_modules/execa/readme.md +22 -12
  16. package/dotpi_root/dist/@dotpi/module/node_modules/execa/types/verbose.d.ts +1 -1
  17. package/dotpi_root/dist/@dotpi/module/package.json +5 -6
  18. package/dotpi_root/dist/@dotpi/module/src/install.js +6 -1
  19. package/dotpi_root/dist/@dotpi/module/src/pnpm.js +18 -14
  20. package/dotpi_root/dist/@dotpi/module/src/uninstall.js +7 -3
  21. package/dotpi_root/dist/@dotpi/module-module/bin/dotpi_module +10 -1
  22. package/dotpi_root/dist/@dotpi/module-module/package.json +4 -4
  23. package/dotpi_root/etc/dotpi_environment_default.bash +1 -4
  24. package/dotpi_root/share/dotpi_functions/dotpi_functions_audio_device.bash +37 -3
  25. package/package.json +8 -5
  26. package/dotpi_root/dist/@dotpi/avahi-monitor-module/node_modules/.package-lock.json +0 -7
  27. package/dotpi_root/dist/@dotpi/javascript/node_modules/.package-lock.json +0 -308
  28. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/license +0 -9
  29. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/package.json +0 -60
  30. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/readme.md +0 -303
  31. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/array-buffer.js +0 -84
  32. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/array.js +0 -32
  33. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/buffer.js +0 -19
  34. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/contents.js +0 -121
  35. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/exports.js +0 -5
  36. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/index.d.ts +0 -121
  37. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/index.js +0 -13
  38. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/stream.js +0 -65
  39. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/string.js +0 -41
  40. package/dotpi_root/dist/@dotpi/javascript/node_modules/get-stream/source/utils.js +0 -11
  41. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/index.d.ts +0 -90
  42. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/index.js +0 -37
  43. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/license +0 -9
  44. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/package.json +0 -48
  45. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-stream/readme.md +0 -57
  46. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/LICENSE.txt +0 -16
  47. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/README.md +0 -74
  48. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
  49. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
  50. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  51. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
  52. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
  53. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
  54. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.js +0 -279
  55. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
  56. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/package.json +0 -3
  57. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
  58. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
  59. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  60. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
  61. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
  62. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
  63. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  64. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
  65. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
  66. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
  67. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.js +0 -275
  68. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
  69. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/package.json +0 -3
  70. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
  71. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
  72. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  73. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
  74. package/dotpi_root/dist/@dotpi/javascript/node_modules/signal-exit/package.json +0 -106
  75. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/license +0 -9
  76. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/package.json +0 -60
  77. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/readme.md +0 -303
  78. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/array-buffer.js +0 -84
  79. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/array.js +0 -32
  80. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/buffer.js +0 -19
  81. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/contents.js +0 -121
  82. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/exports.js +0 -5
  83. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/index.d.ts +0 -121
  84. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/index.js +0 -13
  85. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/stream.js +0 -65
  86. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/string.js +0 -41
  87. package/dotpi_root/dist/@dotpi/module/node_modules/get-stream/source/utils.js +0 -11
  88. package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/index.d.ts +0 -90
  89. package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/index.js +0 -37
  90. package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/license +0 -9
  91. package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/package.json +0 -48
  92. package/dotpi_root/dist/@dotpi/module/node_modules/is-stream/readme.md +0 -57
  93. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/LICENSE.txt +0 -16
  94. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/README.md +0 -74
  95. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
  96. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
  97. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  98. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
  99. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
  100. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
  101. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.js +0 -279
  102. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
  103. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/package.json +0 -3
  104. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
  105. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
  106. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  107. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
  108. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
  109. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
  110. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  111. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
  112. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
  113. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
  114. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.js +0 -275
  115. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
  116. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/package.json +0 -3
  117. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
  118. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
  119. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  120. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
  121. package/dotpi_root/dist/@dotpi/module/node_modules/signal-exit/package.json +0 -106
@@ -1,13 +0,0 @@
1
- import {on} from 'node:events';
2
- import {finished} from 'node:stream/promises';
3
- import {nodeImports} from './stream.js';
4
-
5
- Object.assign(nodeImports, {on, finished});
6
-
7
- export {
8
- default,
9
- getStreamAsArray,
10
- getStreamAsArrayBuffer,
11
- getStreamAsBuffer,
12
- MaxBufferError,
13
- } from './exports.js';
@@ -1,65 +0,0 @@
1
- import {isReadableStream} from 'is-stream';
2
- import {asyncIterator} from '@sec-ant/readable-stream/ponyfill';
3
-
4
- export const getAsyncIterable = stream => {
5
- if (isReadableStream(stream, {checkOpen: false}) && nodeImports.on !== undefined) {
6
- return getStreamIterable(stream);
7
- }
8
-
9
- if (typeof stream?.[Symbol.asyncIterator] === 'function') {
10
- return stream;
11
- }
12
-
13
- // `ReadableStream[Symbol.asyncIterator]` support is missing in multiple browsers, so we ponyfill it
14
- if (toString.call(stream) === '[object ReadableStream]') {
15
- return asyncIterator.call(stream);
16
- }
17
-
18
- throw new TypeError('The first argument must be a Readable, a ReadableStream, or an async iterable.');
19
- };
20
-
21
- const {toString} = Object.prototype;
22
-
23
- // The default iterable for Node.js streams does not allow for multiple readers at once, so we re-implement it
24
- const getStreamIterable = async function * (stream) {
25
- const controller = new AbortController();
26
- const state = {};
27
- handleStreamEnd(stream, controller, state);
28
-
29
- try {
30
- for await (const [chunk] of nodeImports.on(stream, 'data', {signal: controller.signal})) {
31
- yield chunk;
32
- }
33
- } catch (error) {
34
- // Stream failure, for example due to `stream.destroy(error)`
35
- if (state.error !== undefined) {
36
- throw state.error;
37
- // `error` event directly emitted on stream
38
- } else if (!controller.signal.aborted) {
39
- throw error;
40
- // Otherwise, stream completed successfully
41
- }
42
- // The `finally` block also runs when the caller throws, for example due to the `maxBuffer` option
43
- } finally {
44
- stream.destroy();
45
- }
46
- };
47
-
48
- const handleStreamEnd = async (stream, controller, state) => {
49
- try {
50
- await nodeImports.finished(stream, {
51
- cleanup: true,
52
- readable: true,
53
- writable: false,
54
- error: false,
55
- });
56
- } catch (error) {
57
- state.error = error;
58
- } finally {
59
- controller.abort();
60
- }
61
- };
62
-
63
- // Loaded by the Node entrypoint, but not by the browser one.
64
- // This prevents using dynamic imports.
65
- export const nodeImports = {};
@@ -1,41 +0,0 @@
1
- import {getStreamContents} from './contents.js';
2
- import {
3
- identity,
4
- getContentsProperty,
5
- throwObjectStream,
6
- getLengthProperty,
7
- } from './utils.js';
8
-
9
- export async function getStreamAsString(stream, options) {
10
- return getStreamContents(stream, stringMethods, options);
11
- }
12
-
13
- const initString = () => ({contents: '', textDecoder: new TextDecoder()});
14
-
15
- const useTextDecoder = (chunk, {textDecoder}) => textDecoder.decode(chunk, {stream: true});
16
-
17
- const addStringChunk = (convertedChunk, {contents}) => contents + convertedChunk;
18
-
19
- const truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
20
-
21
- const getFinalStringChunk = ({textDecoder}) => {
22
- const finalChunk = textDecoder.decode();
23
- return finalChunk === '' ? undefined : finalChunk;
24
- };
25
-
26
- const stringMethods = {
27
- init: initString,
28
- convertChunk: {
29
- string: identity,
30
- buffer: useTextDecoder,
31
- arrayBuffer: useTextDecoder,
32
- dataView: useTextDecoder,
33
- typedArray: useTextDecoder,
34
- others: throwObjectStream,
35
- },
36
- getSize: getLengthProperty,
37
- truncateChunk: truncateStringChunk,
38
- addChunk: addStringChunk,
39
- getFinalChunk: getFinalStringChunk,
40
- finalize: getContentsProperty,
41
- };
@@ -1,11 +0,0 @@
1
- export const identity = value => value;
2
-
3
- export const noop = () => undefined;
4
-
5
- export const getContentsProperty = ({contents}) => contents;
6
-
7
- export const throwObjectStream = chunk => {
8
- throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
9
- };
10
-
11
- export const getLengthProperty = convertedChunk => convertedChunk.length;
@@ -1,90 +0,0 @@
1
- import {
2
- type Stream,
3
- type Writable as WritableStream,
4
- type Readable as ReadableStream,
5
- type Duplex as DuplexStream,
6
- type Transform as TransformStream,
7
- } from 'node:stream';
8
-
9
- export type Options = {
10
- /**
11
- When this option is `true`, the method returns `false` if the stream has already been closed.
12
-
13
- @default true
14
- */
15
- checkOpen?: boolean;
16
- };
17
-
18
- /**
19
- @returns Whether `stream` is a [`Stream`](https://nodejs.org/api/stream.html#stream_stream).
20
-
21
- @example
22
- ```
23
- import fs from 'node:fs';
24
- import {isStream} from 'is-stream';
25
-
26
- isStream(fs.createReadStream('unicorn.png'));
27
- //=> true
28
-
29
- isStream({});
30
- //=> false
31
- ```
32
- */
33
- export function isStream(stream: unknown, options?: Options): stream is Stream;
34
-
35
- /**
36
- @returns Whether `stream` is a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable), an [`http.OutgoingMessage`](https://nodejs.org/api/http.html#class-httpoutgoingmessage), an [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) or an [`http.ClientRequest`](https://nodejs.org/api/http.html#class-httpserverresponse).
37
-
38
- @example
39
- ```
40
- import fs from 'node:fs';
41
- import {isWritableStream} from 'is-stream';
42
-
43
- isWritableStream(fs.createWriteStrem('unicorn.txt'));
44
- //=> true
45
- ```
46
- */
47
- export function isWritableStream(stream: unknown, options?: Options): stream is WritableStream;
48
-
49
- /**
50
- @returns Whether `stream` is a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable) or an [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage).
51
-
52
- @example
53
- ```
54
- import fs from 'node:fs';
55
- import {isReadableStream} from 'is-stream';
56
-
57
- isReadableStream(fs.createReadStream('unicorn.png'));
58
- //=> true
59
- ```
60
- */
61
- export function isReadableStream(stream: unknown, options?: Options): stream is ReadableStream;
62
-
63
- /**
64
- @returns Whether `stream` is a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
65
-
66
- @example
67
- ```
68
- import {Duplex as DuplexStream} from 'node:stream';
69
- import {isDuplexStream} from 'is-stream';
70
-
71
- isDuplexStream(new DuplexStream());
72
- //=> true
73
- ```
74
- */
75
- export function isDuplexStream(stream: unknown, options?: Options): stream is DuplexStream;
76
-
77
- /**
78
- @returns Whether `stream` is a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform).
79
-
80
- @example
81
- ```
82
- import fs from 'node:fs';
83
- import StringifyStream from 'streaming-json-stringify';
84
- import {isTransformStream} from 'is-stream';
85
-
86
- isTransformStream(StringifyStream());
87
- //=> true
88
- ```
89
- */
90
- export function isTransformStream(stream: unknown, options?: Options): stream is TransformStream;
@@ -1,37 +0,0 @@
1
- export function isStream(stream, {checkOpen = true} = {}) {
2
- return stream !== null
3
- && typeof stream === 'object'
4
- && (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined))
5
- && typeof stream.pipe === 'function';
6
- }
7
-
8
- export function isWritableStream(stream, {checkOpen = true} = {}) {
9
- return isStream(stream, {checkOpen})
10
- && (stream.writable || !checkOpen)
11
- && typeof stream.write === 'function'
12
- && typeof stream.end === 'function'
13
- && typeof stream.writable === 'boolean'
14
- && typeof stream.writableObjectMode === 'boolean'
15
- && typeof stream.destroy === 'function'
16
- && typeof stream.destroyed === 'boolean';
17
- }
18
-
19
- export function isReadableStream(stream, {checkOpen = true} = {}) {
20
- return isStream(stream, {checkOpen})
21
- && (stream.readable || !checkOpen)
22
- && typeof stream.read === 'function'
23
- && typeof stream.readable === 'boolean'
24
- && typeof stream.readableObjectMode === 'boolean'
25
- && typeof stream.destroy === 'function'
26
- && typeof stream.destroyed === 'boolean';
27
- }
28
-
29
- export function isDuplexStream(stream, options) {
30
- return isWritableStream(stream, options)
31
- && isReadableStream(stream, options);
32
- }
33
-
34
- export function isTransformStream(stream, options) {
35
- return isDuplexStream(stream, options)
36
- && typeof stream._transform === 'function';
37
- }
@@ -1,9 +0,0 @@
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.
@@ -1,48 +0,0 @@
1
- {
2
- "name": "is-stream",
3
- "version": "4.0.1",
4
- "description": "Check if something is a Node.js stream",
5
- "license": "MIT",
6
- "repository": "sindresorhus/is-stream",
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
- "stream",
31
- "type",
32
- "streams",
33
- "writable",
34
- "readable",
35
- "duplex",
36
- "transform",
37
- "check",
38
- "detect",
39
- "is"
40
- ],
41
- "devDependencies": {
42
- "@types/node": "^20.11.19",
43
- "ava": "^5.3.1",
44
- "tempy": "^3.1.0",
45
- "tsd": "^0.30.5",
46
- "xo": "^0.57.0"
47
- }
48
- }
@@ -1,57 +0,0 @@
1
- # is-stream
2
-
3
- > Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)
4
-
5
- ## Install
6
-
7
- ```sh
8
- npm install is-stream
9
- ```
10
-
11
- ## Usage
12
-
13
- ```js
14
- import fs from 'node:fs';
15
- import {isStream} from 'is-stream';
16
-
17
- isStream(fs.createReadStream('unicorn.png'));
18
- //=> true
19
-
20
- isStream({});
21
- //=> false
22
- ```
23
-
24
- ## API
25
-
26
- ### isStream(stream, options?)
27
-
28
- Returns a `boolean` for whether it's a [`Stream`](https://nodejs.org/api/stream.html#stream_stream).
29
-
30
- ### isWritableStream(stream, options?)
31
-
32
- Returns a `boolean` for whether it's a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable), an [`http.OutgoingMessage`](https://nodejs.org/api/http.html#class-httpoutgoingmessage), an [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) or an [`http.ClientRequest`](https://nodejs.org/api/http.html#class-httpserverresponse).
33
-
34
- ### isReadableStream(stream, options?)
35
-
36
- Returns a `boolean` for whether it's a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable) or an [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage).
37
-
38
- ### isDuplexStream(stream, options?)
39
-
40
- Returns a `boolean` for whether it's a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
41
-
42
- ### isTransformStream(stream, options?)
43
-
44
- Returns a `boolean` for whether it's a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform).
45
-
46
- ### Options
47
-
48
- #### checkOpen
49
-
50
- Type: `boolean`\
51
- Default: `true`
52
-
53
- When this option is `true`, the method returns `false` if the stream has already been closed.
54
-
55
- ## Related
56
-
57
- - [is-file-stream](https://github.com/jamestalmage/is-file-stream) - Detect if a stream is a file stream
@@ -1,16 +0,0 @@
1
- The ISC License
2
-
3
- Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors
4
-
5
- Permission to use, copy, modify, and/or distribute this software
6
- for any purpose with or without fee is hereby granted, provided
7
- that the above copyright notice and this permission notice
8
- appear in all copies.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
12
- OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
13
- LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
14
- OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
15
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
16
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,74 +0,0 @@
1
- # signal-exit
2
-
3
- When you want to fire an event no matter how a process exits:
4
-
5
- - reaching the end of execution.
6
- - explicitly having `process.exit(code)` called.
7
- - having `process.kill(pid, sig)` called.
8
- - receiving a fatal signal from outside the process
9
-
10
- Use `signal-exit`.
11
-
12
- ```js
13
- // Hybrid module, either works
14
- import { onExit } from 'signal-exit'
15
- // or:
16
- // const { onExit } = require('signal-exit')
17
-
18
- onExit((code, signal) => {
19
- console.log('process exited!', code, signal)
20
- })
21
- ```
22
-
23
- ## API
24
-
25
- `remove = onExit((code, signal) => {}, options)`
26
-
27
- The return value of the function is a function that will remove
28
- the handler.
29
-
30
- Note that the function _only_ fires for signals if the signal
31
- would cause the process to exit. That is, there are no other
32
- listeners, and it is a fatal signal.
33
-
34
- If the global `process` object is not suitable for this purpose
35
- (ie, it's unset, or doesn't have an `emit` method, etc.) then the
36
- `onExit` function is a no-op that returns a no-op `remove` method.
37
-
38
- ### Options
39
-
40
- - `alwaysLast`: Run this handler after any other signal or exit
41
- handlers. This causes `process.emit` to be monkeypatched.
42
-
43
- ### Capturing Signal Exits
44
-
45
- If the handler returns an exact boolean `true`, and the exit is a
46
- due to signal, then the signal will be considered handled, and
47
- will _not_ trigger a synthetic `process.kill(process.pid,
48
- signal)` after firing the `onExit` handlers.
49
-
50
- In this case, it your responsibility as the caller to exit with a
51
- signal (for example, by calling `process.kill()`) if you wish to
52
- preserve the same exit status that would otherwise have occurred.
53
- If you do not, then the process will likely exit gracefully with
54
- status 0 at some point, assuming that no other terminating signal
55
- or other exit trigger occurs.
56
-
57
- Prior to calling handlers, the `onExit` machinery is unloaded, so
58
- any subsequent exits or signals will not be handled, even if the
59
- signal is captured and the exit is thus prevented.
60
-
61
- Note that numeric code exits may indicate that the process is
62
- already committed to exiting, for example due to a fatal
63
- exception or unhandled promise rejection, and so there is no way to
64
- prevent it safely.
65
-
66
- ### Browser Fallback
67
-
68
- The `'signal-exit/browser'` module is the same fallback shim that
69
- just doesn't do anything, but presents the same function
70
- interface.
71
-
72
- Patches welcome to add something that hooks onto
73
- `window.onbeforeunload` or similar, but it might just not be a
74
- thing that makes sense there.
@@ -1,12 +0,0 @@
1
- /**
2
- * This is a browser shim that provides the same functional interface
3
- * as the main node export, but it does nothing.
4
- * @module
5
- */
6
- import type { Handler } from './index.js';
7
- export declare const onExit: (cb: Handler, opts: {
8
- alwaysLast?: boolean;
9
- }) => () => void;
10
- export declare const load: () => void;
11
- export declare const unload: () => void;
12
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unload = exports.load = exports.onExit = void 0;
4
- const onExit = () => () => { };
5
- exports.onExit = onExit;
6
- const load = () => { };
7
- exports.load = load;
8
- const unload = () => { };
9
- exports.unload = unload;
10
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAMO,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAHnB,QAAA,MAAM,UAGa;AACzB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAf,QAAA,IAAI,QAAW;AACrB,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAjB,QAAA,MAAM,UAAW","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]}
@@ -1,48 +0,0 @@
1
- /// <reference types="node" />
2
- import { signals } from './signals.js';
3
- export { signals };
4
- /**
5
- * A function that takes an exit code and signal as arguments
6
- *
7
- * In the case of signal exits *only*, a return value of true
8
- * will indicate that the signal is being handled, and we should
9
- * not synthetically exit with the signal we received. Regardless
10
- * of the handler return value, the handler is unloaded when an
11
- * otherwise fatal signal is received, so you get exactly 1 shot
12
- * at it, unless you add another onExit handler at that point.
13
- *
14
- * In the case of numeric code exits, we may already have committed
15
- * to exiting the process, for example via a fatal exception or
16
- * unhandled promise rejection, so it is impossible to stop safely.
17
- */
18
- export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => true | void;
19
- export declare const
20
- /**
21
- * Called when the process is exiting, whether via signal, explicit
22
- * exit, or running out of stuff to do.
23
- *
24
- * If the global process object is not suitable for instrumentation,
25
- * then this will be a no-op.
26
- *
27
- * Returns a function that may be used to unload signal-exit.
28
- */
29
- onExit: (cb: Handler, opts?: {
30
- alwaysLast?: boolean | undefined;
31
- } | undefined) => () => void,
32
- /**
33
- * Load the listeners. Likely you never need to call this, unless
34
- * doing a rather deep integration with signal-exit functionality.
35
- * Mostly exposed for the benefit of testing.
36
- *
37
- * @internal
38
- */
39
- load: () => void,
40
- /**
41
- * Unload the listeners. Likely you never need to call this, unless
42
- * doing a rather deep integration with signal-exit functionality.
43
- * Mostly exposed for the benefit of testing.
44
- *
45
- * @internal
46
- */
47
- unload: () => void;
48
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,IAAI,GAAG,IAAI,CAAA;AA8QhB,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAzMO,OAAO;;wBAPiD,IAAI;AAkNzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"}