cdk-ecr-deployment 0.0.73 → 0.0.79
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.
- package/.jsii +33 -30
- package/lambda/Dockerfile +25 -0
- package/lambda/install.js +64 -0
- package/lib/index.js +40 -23
- package/node_modules/@sindresorhus/is/dist/index.d.ts +225 -0
- package/node_modules/@sindresorhus/is/dist/index.js +427 -0
- package/node_modules/@sindresorhus/is/dist/types.d.ts +24 -0
- package/node_modules/@sindresorhus/is/dist/types.js +3 -0
- package/node_modules/@sindresorhus/is/license +9 -0
- package/node_modules/@sindresorhus/is/package.json +96 -0
- package/node_modules/@sindresorhus/is/readme.md +628 -0
- package/node_modules/@szmarczak/http-timer/LICENSE +21 -0
- package/node_modules/@szmarczak/http-timer/README.md +93 -0
- package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
- package/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
- package/node_modules/@szmarczak/http-timer/package.json +72 -0
- package/node_modules/@types/cacheable-request/LICENSE +21 -0
- package/node_modules/@types/cacheable-request/README.md +16 -0
- package/node_modules/@types/cacheable-request/index.d.ts +137 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/cacheable-request/package.json +35 -0
- package/node_modules/@types/http-cache-semantics/LICENSE +21 -0
- package/node_modules/@types/http-cache-semantics/README.md +16 -0
- package/node_modules/@types/http-cache-semantics/index.d.ts +170 -0
- package/node_modules/@types/http-cache-semantics/package.json +25 -0
- package/node_modules/@types/keyv/LICENSE +21 -0
- package/node_modules/@types/keyv/README.md +16 -0
- package/node_modules/@types/keyv/index.d.ts +77 -0
- package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/keyv/package.json +32 -0
- package/node_modules/@types/responselike/LICENSE +21 -0
- package/node_modules/@types/responselike/README.md +16 -0
- package/node_modules/@types/responselike/index.d.ts +34 -0
- package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +16 -0
- package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +912 -0
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +497 -0
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +2142 -0
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1365 -0
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +412 -0
- package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +18 -0
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3307 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +545 -0
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +357 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +643 -0
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +169 -0
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +623 -0
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +1004 -0
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +3748 -0
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +284 -0
- package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1368 -0
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +2100 -0
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +391 -0
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +2738 -0
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +114 -0
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +783 -0
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +455 -0
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +230 -0
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +172 -0
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +555 -0
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1477 -0
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +542 -0
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +424 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +1249 -0
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +94 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1019 -0
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +161 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +204 -0
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +798 -0
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1563 -0
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +378 -0
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +507 -0
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +158 -0
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +649 -0
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/@types/responselike/package.json +25 -0
- package/node_modules/cacheable-lookup/LICENSE +21 -0
- package/node_modules/cacheable-lookup/README.md +240 -0
- package/node_modules/cacheable-lookup/index.d.ts +139 -0
- package/node_modules/cacheable-lookup/package.json +45 -0
- package/node_modules/cacheable-lookup/source/index.js +436 -0
- package/node_modules/cacheable-request/LICENSE +21 -0
- package/node_modules/cacheable-request/README.md +206 -0
- package/node_modules/cacheable-request/package.json +56 -0
- package/node_modules/cacheable-request/src/index.js +251 -0
- package/node_modules/clone-response/LICENSE +21 -0
- package/node_modules/clone-response/README.md +62 -0
- package/node_modules/clone-response/package.json +44 -0
- package/node_modules/clone-response/src/index.js +17 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/decompress-response/node_modules/mimic-response/index.js +77 -0
- package/node_modules/decompress-response/node_modules/mimic-response/license +9 -0
- package/node_modules/decompress-response/node_modules/mimic-response/package.json +42 -0
- package/node_modules/decompress-response/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/defer-to-connect/LICENSE +21 -0
- package/node_modules/defer-to-connect/README.md +38 -0
- package/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
- package/node_modules/defer-to-connect/dist/source/index.js +47 -0
- package/node_modules/defer-to-connect/package.json +71 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/get-stream/buffer-stream.js +52 -0
- package/node_modules/get-stream/index.d.ts +108 -0
- package/node_modules/get-stream/index.js +60 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +50 -0
- package/node_modules/get-stream/readme.md +124 -0
- package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +2 -0
- package/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
- package/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/index.js +175 -0
- package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
- package/node_modules/got/dist/source/as-promise/parse-body.d.ts +3 -0
- package/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
- package/node_modules/got/dist/source/as-promise/types.d.ts +256 -0
- package/node_modules/got/dist/source/as-promise/types.js +40 -0
- package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +5 -0
- package/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
- package/node_modules/got/dist/source/core/index.d.ts +1124 -0
- package/node_modules/got/dist/source/core/index.js +1491 -0
- package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
- package/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
- package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
- package/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
- package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +4 -0
- package/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
- package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
- package/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
- package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +2 -0
- package/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
- package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +14 -0
- package/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
- package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
- package/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
- package/node_modules/got/dist/source/core/utils/timed-out.d.ts +29 -0
- package/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
- package/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
- package/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
- package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
- package/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
- package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
- package/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
- package/node_modules/got/dist/source/create.d.ts +5 -0
- package/node_modules/got/dist/source/create.js +240 -0
- package/node_modules/got/dist/source/index.d.ts +4 -0
- package/node_modules/got/dist/source/index.js +132 -0
- package/node_modules/got/dist/source/types.d.ts +342 -0
- package/node_modules/got/dist/source/types.js +2 -0
- package/node_modules/got/dist/source/utils/deep-freeze.d.ts +1 -0
- package/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
- package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +2 -0
- package/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
- package/node_modules/got/license +9 -0
- package/node_modules/got/package.json +130 -0
- package/node_modules/got/readme.md +2476 -0
- package/node_modules/http-cache-semantics/LICENSE +9 -0
- package/node_modules/http-cache-semantics/README.md +203 -0
- package/node_modules/http-cache-semantics/index.js +673 -0
- package/node_modules/http-cache-semantics/package.json +24 -0
- package/node_modules/http2-wrapper/LICENSE +21 -0
- package/node_modules/http2-wrapper/README.md +470 -0
- package/node_modules/http2-wrapper/package.json +54 -0
- package/node_modules/http2-wrapper/source/agent.js +670 -0
- package/node_modules/http2-wrapper/source/auto.js +149 -0
- package/node_modules/http2-wrapper/source/client-request.js +445 -0
- package/node_modules/http2-wrapper/source/incoming-message.js +58 -0
- package/node_modules/http2-wrapper/source/index.js +28 -0
- package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
- package/node_modules/http2-wrapper/source/utils/errors.js +45 -0
- package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
- package/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
- package/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
- package/node_modules/json-buffer/.travis.yml +3 -0
- package/node_modules/json-buffer/LICENSE +22 -0
- package/node_modules/json-buffer/README.md +24 -0
- package/node_modules/json-buffer/index.js +58 -0
- package/node_modules/json-buffer/package.json +34 -0
- package/node_modules/json-buffer/test/index.js +63 -0
- package/node_modules/keyv/LICENSE +21 -0
- package/node_modules/keyv/README.md +288 -0
- package/node_modules/keyv/package.json +49 -0
- package/node_modules/keyv/src/index.js +111 -0
- package/node_modules/lowercase-keys/index.d.ts +16 -0
- package/node_modules/lowercase-keys/index.js +10 -0
- package/node_modules/lowercase-keys/license +9 -0
- package/node_modules/lowercase-keys/package.json +38 -0
- package/node_modules/lowercase-keys/readme.md +32 -0
- package/node_modules/mimic-response/index.js +32 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +37 -0
- package/node_modules/mimic-response/readme.md +54 -0
- package/node_modules/normalize-url/index.d.ts +267 -0
- package/node_modules/normalize-url/index.js +216 -0
- package/node_modules/normalize-url/license +9 -0
- package/node_modules/normalize-url/package.json +50 -0
- package/node_modules/normalize-url/readme.md +286 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/p-cancelable/index.d.ts +176 -0
- package/node_modules/p-cancelable/index.js +111 -0
- package/node_modules/p-cancelable/license +9 -0
- package/node_modules/p-cancelable/package.json +49 -0
- package/node_modules/p-cancelable/readme.md +153 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +65 -0
- package/node_modules/pump/index.js +82 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/quick-lru/index.d.ts +97 -0
- package/node_modules/quick-lru/index.js +123 -0
- package/node_modules/quick-lru/license +9 -0
- package/node_modules/quick-lru/package.json +43 -0
- package/node_modules/quick-lru/readme.md +111 -0
- package/node_modules/resolve-alpn/LICENSE +22 -0
- package/node_modules/resolve-alpn/README.md +60 -0
- package/node_modules/resolve-alpn/index.js +43 -0
- package/node_modules/resolve-alpn/package.json +34 -0
- package/node_modules/responselike/LICENSE +19 -0
- package/node_modules/responselike/README.md +77 -0
- package/node_modules/responselike/package.json +38 -0
- package/node_modules/responselike/src/index.js +34 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +24 -21
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# mimic-response [](https://travis-ci.com/sindresorhus/mimic-response)
|
|
2
|
+
|
|
3
|
+
> Mimic a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ npm install mimic-response
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
const stream = require('stream');
|
|
15
|
+
const mimicResponse = require('mimic-response');
|
|
16
|
+
|
|
17
|
+
const responseStream = getHttpResponseStream();
|
|
18
|
+
const myStream = new stream.PassThrough();
|
|
19
|
+
|
|
20
|
+
mimicResponse(responseStream, myStream);
|
|
21
|
+
|
|
22
|
+
console.log(myStream.statusCode);
|
|
23
|
+
//=> 200
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
### mimicResponse(from, to)
|
|
29
|
+
|
|
30
|
+
**Note #1:** The `from.destroy(error)` function is not proxied. You have to call it manually:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const stream = require('stream');
|
|
34
|
+
const mimicResponse = require('mimic-response');
|
|
35
|
+
|
|
36
|
+
const responseStream = getHttpResponseStream();
|
|
37
|
+
|
|
38
|
+
const myStream = new stream.PassThrough({
|
|
39
|
+
destroy(error, callback) {
|
|
40
|
+
responseStream.destroy();
|
|
41
|
+
|
|
42
|
+
callback(error);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
myStream.destroy();
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Please note that `myStream` and `responseStream` never throws. The error is passed to the request instead.
|
|
50
|
+
|
|
51
|
+
#### from
|
|
52
|
+
|
|
53
|
+
Type: `Stream`
|
|
54
|
+
|
|
55
|
+
[Node.js HTTP response stream.](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
|
|
56
|
+
|
|
57
|
+
#### to
|
|
58
|
+
|
|
59
|
+
Type: `Stream`
|
|
60
|
+
|
|
61
|
+
Any stream.
|
|
62
|
+
|
|
63
|
+
## Related
|
|
64
|
+
|
|
65
|
+
- [mimic-fn](https://github.com/sindresorhus/mimic-fn) - Make a function mimic another one
|
|
66
|
+
- [clone-response](https://github.com/lukechilds/clone-response) - Clone a Node.js response stream
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
<div align="center">
|
|
71
|
+
<b>
|
|
72
|
+
<a href="https://tidelift.com/subscription/pkg/npm-mimic-response?utm_source=npm-mimic-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
73
|
+
</b>
|
|
74
|
+
<br>
|
|
75
|
+
<sub>
|
|
76
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
77
|
+
</sub>
|
|
78
|
+
</div>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "decompress-response",
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "Decompress a HTTP response if needed",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/decompress-response",
|
|
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
|
+
"engines": {
|
|
14
|
+
"node": ">=10"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "xo && ava && tsd"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"decompress",
|
|
25
|
+
"response",
|
|
26
|
+
"http",
|
|
27
|
+
"https",
|
|
28
|
+
"zlib",
|
|
29
|
+
"gzip",
|
|
30
|
+
"zip",
|
|
31
|
+
"deflate",
|
|
32
|
+
"unzip",
|
|
33
|
+
"ungzip",
|
|
34
|
+
"incoming",
|
|
35
|
+
"message",
|
|
36
|
+
"stream",
|
|
37
|
+
"compressed",
|
|
38
|
+
"brotli"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"mimic-response": "^3.1.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^14.0.1",
|
|
45
|
+
"ava": "^2.2.0",
|
|
46
|
+
"get-stream": "^5.0.0",
|
|
47
|
+
"pify": "^5.0.0",
|
|
48
|
+
"tsd": "^0.11.0",
|
|
49
|
+
"xo": "^0.30.0"
|
|
50
|
+
},
|
|
51
|
+
"xo": {
|
|
52
|
+
"rules": {
|
|
53
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# decompress-response [](https://travis-ci.com/sindresorhus/decompress-response)
|
|
2
|
+
|
|
3
|
+
> Decompress a HTTP response if needed
|
|
4
|
+
|
|
5
|
+
Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_incomingmessage) from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped, deflated or compressed with Brotli, otherwise just passes it through.
|
|
6
|
+
|
|
7
|
+
Used by [`got`](https://github.com/sindresorhus/got).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ npm install decompress-response
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const http = require('http');
|
|
19
|
+
const decompressResponse = require('decompress-response');
|
|
20
|
+
|
|
21
|
+
http.get('https://sindresorhus.com', response => {
|
|
22
|
+
response = decompressResponse(response);
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
### decompressResponse(response)
|
|
29
|
+
|
|
30
|
+
Returns the decompressed HTTP response stream.
|
|
31
|
+
|
|
32
|
+
#### response
|
|
33
|
+
|
|
34
|
+
Type: [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
|
|
35
|
+
|
|
36
|
+
The HTTP incoming stream with compressed data.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<div align="center">
|
|
41
|
+
<b>
|
|
42
|
+
<a href="https://tidelift.com/subscription/pkg/npm-decompress-response?utm_source=npm-decompress-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
43
|
+
</b>
|
|
44
|
+
<br>
|
|
45
|
+
<sub>
|
|
46
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
47
|
+
</sub>
|
|
48
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Szymon Marczak
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# defer-to-connect
|
|
2
|
+
|
|
3
|
+
> The safe way to handle the `connect` socket event
|
|
4
|
+
|
|
5
|
+
[](https://coveralls.io/github/szmarczak/defer-to-connect?branch=master)
|
|
6
|
+
|
|
7
|
+
Once you receive the socket, it may be already connected (or disconnected).<br>
|
|
8
|
+
To avoid checking that, use `defer-to-connect`. It'll do that for you.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
const deferToConnect = require('defer-to-connect');
|
|
14
|
+
|
|
15
|
+
deferToConnect(socket, () => {
|
|
16
|
+
console.log('Connected!');
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## API
|
|
21
|
+
|
|
22
|
+
### deferToConnect(socket, connectListener)
|
|
23
|
+
|
|
24
|
+
Calls `connectListener()` when connected.
|
|
25
|
+
|
|
26
|
+
### deferToConnect(socket, listeners)
|
|
27
|
+
|
|
28
|
+
#### listeners
|
|
29
|
+
|
|
30
|
+
An object representing `connect`, `secureConnect` and `close` properties.
|
|
31
|
+
|
|
32
|
+
Calls `connect()` when the socket is connected.<br>
|
|
33
|
+
Calls `secureConnect()` when the socket is securely connected.<br>
|
|
34
|
+
Calls `close()` when the socket is destroyed.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Socket } from 'net';
|
|
3
|
+
import { TLSSocket } from 'tls';
|
|
4
|
+
interface Listeners {
|
|
5
|
+
connect?: () => void;
|
|
6
|
+
secureConnect?: () => void;
|
|
7
|
+
close?: (hadError: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const deferToConnect: (socket: TLSSocket | Socket, fn: Listeners | (() => void)) => void;
|
|
10
|
+
export default deferToConnect;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function isTLSSocket(socket) {
|
|
4
|
+
return socket.encrypted;
|
|
5
|
+
}
|
|
6
|
+
const deferToConnect = (socket, fn) => {
|
|
7
|
+
let listeners;
|
|
8
|
+
if (typeof fn === 'function') {
|
|
9
|
+
const connect = fn;
|
|
10
|
+
listeners = { connect };
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
listeners = fn;
|
|
14
|
+
}
|
|
15
|
+
const hasConnectListener = typeof listeners.connect === 'function';
|
|
16
|
+
const hasSecureConnectListener = typeof listeners.secureConnect === 'function';
|
|
17
|
+
const hasCloseListener = typeof listeners.close === 'function';
|
|
18
|
+
const onConnect = () => {
|
|
19
|
+
if (hasConnectListener) {
|
|
20
|
+
listeners.connect();
|
|
21
|
+
}
|
|
22
|
+
if (isTLSSocket(socket) && hasSecureConnectListener) {
|
|
23
|
+
if (socket.authorized) {
|
|
24
|
+
listeners.secureConnect();
|
|
25
|
+
}
|
|
26
|
+
else if (!socket.authorizationError) {
|
|
27
|
+
socket.once('secureConnect', listeners.secureConnect);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (hasCloseListener) {
|
|
31
|
+
socket.once('close', listeners.close);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
if (socket.writable && !socket.connecting) {
|
|
35
|
+
onConnect();
|
|
36
|
+
}
|
|
37
|
+
else if (socket.connecting) {
|
|
38
|
+
socket.once('connect', onConnect);
|
|
39
|
+
}
|
|
40
|
+
else if (socket.destroyed && hasCloseListener) {
|
|
41
|
+
listeners.close(socket._hadError);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = deferToConnect;
|
|
45
|
+
// For CommonJS default export support
|
|
46
|
+
module.exports = deferToConnect;
|
|
47
|
+
module.exports.default = deferToConnect;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "defer-to-connect",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "The safe way to handle the `connect` socket event",
|
|
5
|
+
"main": "dist/source",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/source"
|
|
8
|
+
],
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=10"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "del-cli dist && tsc",
|
|
14
|
+
"prepare": "npm run build",
|
|
15
|
+
"test": "xo && tsc --noEmit && nyc ava",
|
|
16
|
+
"coveralls": "nyc report --reporter=text-lcov | coveralls"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"socket",
|
|
20
|
+
"connect",
|
|
21
|
+
"event"
|
|
22
|
+
],
|
|
23
|
+
"author": "Szymon Marczak",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/szmarczak/defer-to-connect.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/szmarczak/defer-to-connect/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/szmarczak/defer-to-connect#readme",
|
|
33
|
+
"xo": {
|
|
34
|
+
"extends": "xo-typescript",
|
|
35
|
+
"extensions": [
|
|
36
|
+
"ts"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@ava/typescript": "^1.1.0",
|
|
41
|
+
"@sindresorhus/tsconfig": "^0.7.0",
|
|
42
|
+
"@types/node": "^13.5.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^2.18.0",
|
|
44
|
+
"@typescript-eslint/parser": "^2.18.0",
|
|
45
|
+
"ava": "^3.2.0",
|
|
46
|
+
"coveralls": "^3.0.9",
|
|
47
|
+
"create-cert": "^1.0.6",
|
|
48
|
+
"del-cli": "^3.0.0",
|
|
49
|
+
"eslint-config-xo-typescript": "^0.24.1",
|
|
50
|
+
"nyc": "^15.0.0",
|
|
51
|
+
"p-event": "^4.1.0",
|
|
52
|
+
"typescript": "^3.7.5",
|
|
53
|
+
"xo": "^0.25.3"
|
|
54
|
+
},
|
|
55
|
+
"nyc": {
|
|
56
|
+
"include": [
|
|
57
|
+
"dist/source"
|
|
58
|
+
],
|
|
59
|
+
"extension": [
|
|
60
|
+
".ts"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"ava": {
|
|
64
|
+
"typescript": {
|
|
65
|
+
"rewritePaths": {
|
|
66
|
+
"tests/": "dist/tests/"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"types": "dist/source/index.d.ts"
|
|
71
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Mathias Buus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# end-of-stream
|
|
2
|
+
|
|
3
|
+
A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
|
|
4
|
+
|
|
5
|
+
npm install end-of-stream
|
|
6
|
+
|
|
7
|
+
[](https://travis-ci.org/mafintosh/end-of-stream)
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Simply pass a stream and a callback to the `eos`.
|
|
12
|
+
Both legacy streams, streams2 and stream3 are supported.
|
|
13
|
+
|
|
14
|
+
``` js
|
|
15
|
+
var eos = require('end-of-stream');
|
|
16
|
+
|
|
17
|
+
eos(readableStream, function(err) {
|
|
18
|
+
// this will be set to the stream instance
|
|
19
|
+
if (err) return console.log('stream had an error or closed early');
|
|
20
|
+
console.log('stream has ended', this === readableStream);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
eos(writableStream, function(err) {
|
|
24
|
+
if (err) return console.log('stream had an error or closed early');
|
|
25
|
+
console.log('stream has finished', this === writableStream);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
eos(duplexStream, function(err) {
|
|
29
|
+
if (err) return console.log('stream had an error or closed early');
|
|
30
|
+
console.log('stream has ended and finished', this === duplexStream);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
eos(duplexStream, {readable:false}, function(err) {
|
|
34
|
+
if (err) return console.log('stream had an error or closed early');
|
|
35
|
+
console.log('stream has finished but might still be readable');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
eos(duplexStream, {writable:false}, function(err) {
|
|
39
|
+
if (err) return console.log('stream had an error or closed early');
|
|
40
|
+
console.log('stream has ended but might still be writable');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
eos(readableStream, {error:false}, function(err) {
|
|
44
|
+
// do not treat emit('error', err) as a end-of-stream
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|
|
51
|
+
|
|
52
|
+
## Related
|
|
53
|
+
|
|
54
|
+
`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var once = require('once');
|
|
2
|
+
|
|
3
|
+
var noop = function() {};
|
|
4
|
+
|
|
5
|
+
var isRequest = function(stream) {
|
|
6
|
+
return stream.setHeader && typeof stream.abort === 'function';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
var isChildProcess = function(stream) {
|
|
10
|
+
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var eos = function(stream, opts, callback) {
|
|
14
|
+
if (typeof opts === 'function') return eos(stream, null, opts);
|
|
15
|
+
if (!opts) opts = {};
|
|
16
|
+
|
|
17
|
+
callback = once(callback || noop);
|
|
18
|
+
|
|
19
|
+
var ws = stream._writableState;
|
|
20
|
+
var rs = stream._readableState;
|
|
21
|
+
var readable = opts.readable || (opts.readable !== false && stream.readable);
|
|
22
|
+
var writable = opts.writable || (opts.writable !== false && stream.writable);
|
|
23
|
+
var cancelled = false;
|
|
24
|
+
|
|
25
|
+
var onlegacyfinish = function() {
|
|
26
|
+
if (!stream.writable) onfinish();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var onfinish = function() {
|
|
30
|
+
writable = false;
|
|
31
|
+
if (!readable) callback.call(stream);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var onend = function() {
|
|
35
|
+
readable = false;
|
|
36
|
+
if (!writable) callback.call(stream);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var onexit = function(exitCode) {
|
|
40
|
+
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var onerror = function(err) {
|
|
44
|
+
callback.call(stream, err);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var onclose = function() {
|
|
48
|
+
process.nextTick(onclosenexttick);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var onclosenexttick = function() {
|
|
52
|
+
if (cancelled) return;
|
|
53
|
+
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
|
|
54
|
+
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var onrequest = function() {
|
|
58
|
+
stream.req.on('finish', onfinish);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (isRequest(stream)) {
|
|
62
|
+
stream.on('complete', onfinish);
|
|
63
|
+
stream.on('abort', onclose);
|
|
64
|
+
if (stream.req) onrequest();
|
|
65
|
+
else stream.on('request', onrequest);
|
|
66
|
+
} else if (writable && !ws) { // legacy streams
|
|
67
|
+
stream.on('end', onlegacyfinish);
|
|
68
|
+
stream.on('close', onlegacyfinish);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (isChildProcess(stream)) stream.on('exit', onexit);
|
|
72
|
+
|
|
73
|
+
stream.on('end', onend);
|
|
74
|
+
stream.on('finish', onfinish);
|
|
75
|
+
if (opts.error !== false) stream.on('error', onerror);
|
|
76
|
+
stream.on('close', onclose);
|
|
77
|
+
|
|
78
|
+
return function() {
|
|
79
|
+
cancelled = true;
|
|
80
|
+
stream.removeListener('complete', onfinish);
|
|
81
|
+
stream.removeListener('abort', onclose);
|
|
82
|
+
stream.removeListener('request', onrequest);
|
|
83
|
+
if (stream.req) stream.req.removeListener('finish', onfinish);
|
|
84
|
+
stream.removeListener('end', onlegacyfinish);
|
|
85
|
+
stream.removeListener('close', onlegacyfinish);
|
|
86
|
+
stream.removeListener('finish', onfinish);
|
|
87
|
+
stream.removeListener('exit', onexit);
|
|
88
|
+
stream.removeListener('end', onend);
|
|
89
|
+
stream.removeListener('error', onerror);
|
|
90
|
+
stream.removeListener('close', onclose);
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
module.exports = eos;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "end-of-stream",
|
|
3
|
+
"version": "1.4.4",
|
|
4
|
+
"description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git://github.com/mafintosh/end-of-stream.git"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"once": "^1.4.0"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "node test.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"stream",
|
|
20
|
+
"streams",
|
|
21
|
+
"callback",
|
|
22
|
+
"finish",
|
|
23
|
+
"close",
|
|
24
|
+
"end",
|
|
25
|
+
"wait"
|
|
26
|
+
],
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/mafintosh/end-of-stream/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/mafintosh/end-of-stream",
|
|
31
|
+
"main": "index.js",
|
|
32
|
+
"author": "Mathias Buus <mathiasbuus@gmail.com>",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"tape": "^4.11.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const {PassThrough: PassThroughStream} = require('stream');
|
|
3
|
+
|
|
4
|
+
module.exports = options => {
|
|
5
|
+
options = {...options};
|
|
6
|
+
|
|
7
|
+
const {array} = options;
|
|
8
|
+
let {encoding} = options;
|
|
9
|
+
const isBuffer = encoding === 'buffer';
|
|
10
|
+
let objectMode = false;
|
|
11
|
+
|
|
12
|
+
if (array) {
|
|
13
|
+
objectMode = !(encoding || isBuffer);
|
|
14
|
+
} else {
|
|
15
|
+
encoding = encoding || 'utf8';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (isBuffer) {
|
|
19
|
+
encoding = null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const stream = new PassThroughStream({objectMode});
|
|
23
|
+
|
|
24
|
+
if (encoding) {
|
|
25
|
+
stream.setEncoding(encoding);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let length = 0;
|
|
29
|
+
const chunks = [];
|
|
30
|
+
|
|
31
|
+
stream.on('data', chunk => {
|
|
32
|
+
chunks.push(chunk);
|
|
33
|
+
|
|
34
|
+
if (objectMode) {
|
|
35
|
+
length = chunks.length;
|
|
36
|
+
} else {
|
|
37
|
+
length += chunk.length;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
stream.getBufferedValue = () => {
|
|
42
|
+
if (array) {
|
|
43
|
+
return chunks;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
stream.getBufferedLength = () => length;
|
|
50
|
+
|
|
51
|
+
return stream;
|
|
52
|
+
};
|