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,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* istanbul ignore file: https://github.com/nodejs/node/blob/master/lib/internal/errors.js */
|
|
3
|
+
|
|
4
|
+
const makeError = (Base, key, getMessage) => {
|
|
5
|
+
module.exports[key] = class NodeError extends Base {
|
|
6
|
+
constructor(...args) {
|
|
7
|
+
super(typeof getMessage === 'string' ? getMessage : getMessage(args));
|
|
8
|
+
this.name = `${super.name} [${key}]`;
|
|
9
|
+
this.code = key;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
makeError(TypeError, 'ERR_INVALID_ARG_TYPE', args => {
|
|
15
|
+
const type = args[0].includes('.') ? 'property' : 'argument';
|
|
16
|
+
|
|
17
|
+
let valid = args[1];
|
|
18
|
+
const isManyTypes = Array.isArray(valid);
|
|
19
|
+
|
|
20
|
+
if (isManyTypes) {
|
|
21
|
+
valid = `${valid.slice(0, -1).join(', ')} or ${valid.slice(-1)}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return `The "${args[0]}" ${type} must be ${isManyTypes ? 'one of' : 'of'} type ${valid}. Received ${typeof args[2]}`;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
makeError(TypeError, 'ERR_INVALID_PROTOCOL', args => {
|
|
28
|
+
return `Protocol "${args[0]}" not supported. Expected "${args[1]}"`;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
makeError(Error, 'ERR_HTTP_HEADERS_SENT', args => {
|
|
32
|
+
return `Cannot ${args[0]} headers after they are sent to the client`;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
makeError(TypeError, 'ERR_INVALID_HTTP_TOKEN', args => {
|
|
36
|
+
return `${args[0]} must be a valid HTTP token [${args[1]}]`;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
makeError(TypeError, 'ERR_HTTP_INVALID_HEADER_VALUE', args => {
|
|
40
|
+
return `Invalid value "${args[0]} for header "${args[1]}"`;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
makeError(TypeError, 'ERR_INVALID_CHAR', args => {
|
|
44
|
+
return `Invalid character in ${args[0]} [${args[1]}]`;
|
|
45
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* istanbul ignore file: https://github.com/nodejs/node/blob/a91293d4d9ab403046ab5eb022332e4e3d249bd3/lib/internal/url.js#L1257 */
|
|
3
|
+
|
|
4
|
+
module.exports = url => {
|
|
5
|
+
const options = {
|
|
6
|
+
protocol: url.protocol,
|
|
7
|
+
hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
|
|
8
|
+
host: url.host,
|
|
9
|
+
hash: url.hash,
|
|
10
|
+
search: url.search,
|
|
11
|
+
pathname: url.pathname,
|
|
12
|
+
href: url.href,
|
|
13
|
+
path: `${url.pathname || ''}${url.search || ''}`
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
if (typeof url.port === 'string' && url.port.length !== 0) {
|
|
17
|
+
options.port = Number(url.port);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (url.username || url.password) {
|
|
21
|
+
options.auth = `${url.username || ''}:${url.password || ''}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return options;
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Dominic Tarr
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge,
|
|
4
|
+
to any person obtaining a copy of this software and
|
|
5
|
+
associated documentation files (the "Software"), to
|
|
6
|
+
deal in the Software without restriction, including
|
|
7
|
+
without limitation the rights to use, copy, modify,
|
|
8
|
+
merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom
|
|
10
|
+
the Software is furnished to do so,
|
|
11
|
+
subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice
|
|
14
|
+
shall be included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
20
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# json-buffer
|
|
2
|
+
|
|
3
|
+
JSON functions that can convert buffers!
|
|
4
|
+
|
|
5
|
+
[](http://travis-ci.org/dominictarr/json-buffer)
|
|
6
|
+
|
|
7
|
+
[](https://ci.testling.com/dominictarr/json-buffer)
|
|
8
|
+
|
|
9
|
+
JSON mangles buffers by converting to an array...
|
|
10
|
+
which isn't helpful. json-buffers converts to base64 instead,
|
|
11
|
+
and deconverts base64 to a buffer.
|
|
12
|
+
|
|
13
|
+
``` js
|
|
14
|
+
var JSONB = require('json-buffer')
|
|
15
|
+
var Buffer = require('buffer').Buffer
|
|
16
|
+
|
|
17
|
+
var str = JSONB.stringify(Buffer.from('hello there!'))
|
|
18
|
+
|
|
19
|
+
console.log(JSONB.parse(str)) //GET a BUFFER back
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
MIT
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//TODO: handle reviver/dehydrate function like normal
|
|
2
|
+
//and handle indentation, like normal.
|
|
3
|
+
//if anyone needs this... please send pull request.
|
|
4
|
+
|
|
5
|
+
exports.stringify = function stringify (o) {
|
|
6
|
+
if('undefined' == typeof o) return o
|
|
7
|
+
|
|
8
|
+
if(o && Buffer.isBuffer(o))
|
|
9
|
+
return JSON.stringify(':base64:' + o.toString('base64'))
|
|
10
|
+
|
|
11
|
+
if(o && o.toJSON)
|
|
12
|
+
o = o.toJSON()
|
|
13
|
+
|
|
14
|
+
if(o && 'object' === typeof o) {
|
|
15
|
+
var s = ''
|
|
16
|
+
var array = Array.isArray(o)
|
|
17
|
+
s = array ? '[' : '{'
|
|
18
|
+
var first = true
|
|
19
|
+
|
|
20
|
+
for(var k in o) {
|
|
21
|
+
var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])
|
|
22
|
+
if(Object.hasOwnProperty.call(o, k) && !ignore) {
|
|
23
|
+
if(!first)
|
|
24
|
+
s += ','
|
|
25
|
+
first = false
|
|
26
|
+
if (array) {
|
|
27
|
+
if(o[k] == undefined)
|
|
28
|
+
s += 'null'
|
|
29
|
+
else
|
|
30
|
+
s += stringify(o[k])
|
|
31
|
+
} else if (o[k] !== void(0)) {
|
|
32
|
+
s += stringify(k) + ':' + stringify(o[k])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
s += array ? ']' : '}'
|
|
38
|
+
|
|
39
|
+
return s
|
|
40
|
+
} else if ('string' === typeof o) {
|
|
41
|
+
return JSON.stringify(/^:/.test(o) ? ':' + o : o)
|
|
42
|
+
} else if ('undefined' === typeof o) {
|
|
43
|
+
return 'null';
|
|
44
|
+
} else
|
|
45
|
+
return JSON.stringify(o)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.parse = function (s) {
|
|
49
|
+
return JSON.parse(s, function (key, value) {
|
|
50
|
+
if('string' === typeof value) {
|
|
51
|
+
if(/^:base64:/.test(value))
|
|
52
|
+
return Buffer.from(value.substring(8), 'base64')
|
|
53
|
+
else
|
|
54
|
+
return /^:/.test(value) ? value.substring(1) : value
|
|
55
|
+
}
|
|
56
|
+
return value
|
|
57
|
+
})
|
|
58
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "json-buffer",
|
|
3
|
+
"description": "JSON parse & stringify that supports binary via bops & base64",
|
|
4
|
+
"version": "3.0.1",
|
|
5
|
+
"homepage": "https://github.com/dominictarr/json-buffer",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/dominictarr/json-buffer.git"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"tape": "^4.6.3"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "set -e; for t in test/*.js; do node $t; done"
|
|
15
|
+
},
|
|
16
|
+
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"testling": {
|
|
19
|
+
"files": "test/*.js",
|
|
20
|
+
"browsers": [
|
|
21
|
+
"ie/8..latest",
|
|
22
|
+
"firefox/17..latest",
|
|
23
|
+
"firefox/nightly",
|
|
24
|
+
"chrome/22..latest",
|
|
25
|
+
"chrome/canary",
|
|
26
|
+
"opera/12..latest",
|
|
27
|
+
"opera/next",
|
|
28
|
+
"safari/5.1..latest",
|
|
29
|
+
"ipad/6.0..latest",
|
|
30
|
+
"iphone/6.0..latest",
|
|
31
|
+
"android-browser/4.2..latest"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
var test = require('tape')
|
|
3
|
+
var _JSON = require('../')
|
|
4
|
+
|
|
5
|
+
function clone (o) {
|
|
6
|
+
return JSON.parse(JSON.stringify(o))
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
var examples = {
|
|
10
|
+
simple: { foo: [], bar: {}, baz: Buffer.from('some binary data') },
|
|
11
|
+
just_buffer: Buffer.from('JUST A BUFFER'),
|
|
12
|
+
all_types: {
|
|
13
|
+
string:'hello',
|
|
14
|
+
number: 3145,
|
|
15
|
+
null: null,
|
|
16
|
+
object: {},
|
|
17
|
+
array: [],
|
|
18
|
+
boolean: true,
|
|
19
|
+
boolean2: false
|
|
20
|
+
},
|
|
21
|
+
foo: Buffer.from('foo'),
|
|
22
|
+
foo2: Buffer.from('foo2'),
|
|
23
|
+
escape: {
|
|
24
|
+
buffer: Buffer.from('x'),
|
|
25
|
+
string: _JSON.stringify(Buffer.from('x'))
|
|
26
|
+
},
|
|
27
|
+
escape2: {
|
|
28
|
+
buffer: Buffer.from('x'),
|
|
29
|
+
string: ':base64:'+ Buffer.from('x').toString('base64')
|
|
30
|
+
},
|
|
31
|
+
undefined: {
|
|
32
|
+
empty: undefined, test: true
|
|
33
|
+
},
|
|
34
|
+
undefined2: {
|
|
35
|
+
first: 1, empty: undefined, test: true
|
|
36
|
+
},
|
|
37
|
+
undefinedArray: {
|
|
38
|
+
array: [undefined, 1, 'two']
|
|
39
|
+
},
|
|
40
|
+
fn: {
|
|
41
|
+
fn: function () {}
|
|
42
|
+
},
|
|
43
|
+
undefined: undefined
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for(k in examples)
|
|
47
|
+
(function (value, k) {
|
|
48
|
+
test(k, function (t) {
|
|
49
|
+
var s = _JSON.stringify(value)
|
|
50
|
+
console.log('parse', s)
|
|
51
|
+
if(JSON.stringify(value) !== undefined) {
|
|
52
|
+
console.log(s)
|
|
53
|
+
var _value = _JSON.parse(s)
|
|
54
|
+
t.deepEqual(clone(_value), clone(value))
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
t.equal(s, undefined)
|
|
58
|
+
t.end()
|
|
59
|
+
})
|
|
60
|
+
})(examples[k], k)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Luke Childs
|
|
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,288 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<img width="250" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">
|
|
3
|
+
<br>
|
|
4
|
+
<br>
|
|
5
|
+
</h1>
|
|
6
|
+
|
|
7
|
+
> Simple key-value storage with support for multiple backends
|
|
8
|
+
|
|
9
|
+
[](https://travis-ci.org/lukechilds/keyv)
|
|
10
|
+
[](https://coveralls.io/github/lukechilds/keyv?branch=master)
|
|
11
|
+
[](https://www.npmjs.com/package/keyv)
|
|
12
|
+
[](https://www.npmjs.com/package/keyv)
|
|
13
|
+
|
|
14
|
+
Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. It supports TTL based expiry, making it suitable as a cache or a persistent key-value store.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
There are a few existing modules similar to Keyv, however Keyv is different because it:
|
|
19
|
+
|
|
20
|
+
- Isn't bloated
|
|
21
|
+
- Has a simple Promise based API
|
|
22
|
+
- Suitable as a TTL based cache or persistent key-value store
|
|
23
|
+
- [Easily embeddable](#add-cache-support-to-your-module) inside another module
|
|
24
|
+
- Works with any storage that implements the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) API
|
|
25
|
+
- Handles all JSON types plus `Buffer`
|
|
26
|
+
- Supports namespaces
|
|
27
|
+
- Wide range of [**efficient, well tested**](#official-storage-adapters) storage adapters
|
|
28
|
+
- Connection errors are passed through (db failures won't kill your app)
|
|
29
|
+
- Supports the current active LTS version of Node.js or higher
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
Install Keyv.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
npm install --save keyv
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
By default everything is stored in memory, you can optionally also install a storage adapter.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
npm install --save @keyv/redis
|
|
43
|
+
npm install --save @keyv/mongo
|
|
44
|
+
npm install --save @keyv/sqlite
|
|
45
|
+
npm install --save @keyv/postgres
|
|
46
|
+
npm install --save @keyv/mysql
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Create a new Keyv instance, passing your connection string if applicable. Keyv will automatically load the correct storage adapter.
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
const Keyv = require('keyv');
|
|
53
|
+
|
|
54
|
+
// One of the following
|
|
55
|
+
const keyv = new Keyv();
|
|
56
|
+
const keyv = new Keyv('redis://user:pass@localhost:6379');
|
|
57
|
+
const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname');
|
|
58
|
+
const keyv = new Keyv('sqlite://path/to/database.sqlite');
|
|
59
|
+
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname');
|
|
60
|
+
const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname');
|
|
61
|
+
|
|
62
|
+
// Handle DB connection errors
|
|
63
|
+
keyv.on('error', err => console.log('Connection Error', err));
|
|
64
|
+
|
|
65
|
+
await keyv.set('foo', 'expires in 1 second', 1000); // true
|
|
66
|
+
await keyv.set('foo', 'never expires'); // true
|
|
67
|
+
await keyv.get('foo'); // 'never expires'
|
|
68
|
+
await keyv.delete('foo'); // true
|
|
69
|
+
await keyv.clear(); // undefined
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Namespaces
|
|
73
|
+
|
|
74
|
+
You can namespace your Keyv instance to avoid key collisions and allow you to clear only a certain namespace while using the same database.
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
const users = new Keyv('redis://user:pass@localhost:6379', { namespace: 'users' });
|
|
78
|
+
const cache = new Keyv('redis://user:pass@localhost:6379', { namespace: 'cache' });
|
|
79
|
+
|
|
80
|
+
await users.set('foo', 'users'); // true
|
|
81
|
+
await cache.set('foo', 'cache'); // true
|
|
82
|
+
await users.get('foo'); // 'users'
|
|
83
|
+
await cache.get('foo'); // 'cache'
|
|
84
|
+
await users.clear(); // undefined
|
|
85
|
+
await users.get('foo'); // undefined
|
|
86
|
+
await cache.get('foo'); // 'cache'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Custom Serializers
|
|
90
|
+
|
|
91
|
+
Keyv uses [`json-buffer`](https://github.com/dominictarr/json-buffer) for data serialization to ensure consistency across different backends.
|
|
92
|
+
|
|
93
|
+
You can optionally provide your own serialization functions to support extra data types or to serialize to something other than JSON.
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
const keyv = new Keyv({ serialize: JSON.stringify, deserialize: JSON.parse });
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Warning:** Using custom serializers means you lose any guarantee of data consistency. You should do extensive testing with your serialisation functions and chosen storage engine.
|
|
100
|
+
|
|
101
|
+
## Official Storage Adapters
|
|
102
|
+
|
|
103
|
+
The official storage adapters are covered by [over 150 integration tests](https://travis-ci.org/lukechilds/keyv/jobs/260418145) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.
|
|
104
|
+
|
|
105
|
+
Database | Adapter | Native TTL | Status
|
|
106
|
+
---|---|---|---
|
|
107
|
+
Redis | [@keyv/redis](https://github.com/lukechilds/keyv-redis) | Yes | [](https://travis-ci.org/lukechilds/keyv-redis) [](https://coveralls.io/github/lukechilds/keyv-redis?branch=master)
|
|
108
|
+
MongoDB | [@keyv/mongo](https://github.com/lukechilds/keyv-mongo) | Yes | [](https://travis-ci.org/lukechilds/keyv-mongo) [](https://coveralls.io/github/lukechilds/keyv-mongo?branch=master)
|
|
109
|
+
SQLite | [@keyv/sqlite](https://github.com/lukechilds/keyv-sqlite) | No | [](https://travis-ci.org/lukechilds/keyv-sqlite) [](https://coveralls.io/github/lukechilds/keyv-sqlite?branch=master)
|
|
110
|
+
PostgreSQL | [@keyv/postgres](https://github.com/lukechilds/keyv-postgres) | No | [](https://travis-ci.org/lukechildskeyv-postgreskeyv) [](https://coveralls.io/github/lukechilds/keyv-postgres?branch=master)
|
|
111
|
+
MySQL | [@keyv/mysql](https://github.com/lukechilds/keyv-mysql) | No | [](https://travis-ci.org/lukechilds/keyv-mysql) [](https://coveralls.io/github/lukechilds/keyv-mysql?branch=master)
|
|
112
|
+
|
|
113
|
+
## Third-party Storage Adapters
|
|
114
|
+
|
|
115
|
+
You can also use third-party storage adapters or build your own. Keyv will wrap these storage adapters in TTL functionality and handle complex types internally.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const Keyv = require('keyv');
|
|
119
|
+
const myAdapter = require('./my-storage-adapter');
|
|
120
|
+
|
|
121
|
+
const keyv = new Keyv({ store: myAdapter });
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Any store that follows the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) api will work.
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
new Keyv({ store: new Map() });
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For example, [`quick-lru`](https://github.com/sindresorhus/quick-lru) is a completely unrelated module that implements the Map API.
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
const Keyv = require('keyv');
|
|
134
|
+
const QuickLRU = require('quick-lru');
|
|
135
|
+
|
|
136
|
+
const lru = new QuickLRU({ maxSize: 1000 });
|
|
137
|
+
const keyv = new Keyv({ store: lru });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The following are third-party storage adapters compatible with Keyv:
|
|
141
|
+
|
|
142
|
+
- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple "Least Recently Used" (LRU) cache
|
|
143
|
+
- [keyv-file](https://github.com/zaaack/keyv-file) - File system storage adapter for Keyv
|
|
144
|
+
- [keyv-dynamodb](https://www.npmjs.com/package/keyv-dynamodb) - DynamoDB storage adapter for Keyv
|
|
145
|
+
- [keyv-firestore ](https://github.com/goto-bus-stop/keyv-firestore) – Firebase Cloud Firestore adapter for Keyv
|
|
146
|
+
- [keyv-mssql](https://github.com/pmorgan3/keyv-mssql) - Microsoft Sql Server adapter for Keyv
|
|
147
|
+
- [keyv-memcache](https://github.com/jaredwray/keyv-memcache) - Memcache storage adapter for Keyv
|
|
148
|
+
|
|
149
|
+
## Add Cache Support to your Module
|
|
150
|
+
|
|
151
|
+
Keyv is designed to be easily embedded into other modules to add cache support. The recommended pattern is to expose a `cache` option in your modules options which is passed through to Keyv. Caching will work in memory by default and users have the option to also install a Keyv storage adapter and pass in a connection string, or any other storage that implements the `Map` API.
|
|
152
|
+
|
|
153
|
+
You should also set a namespace for your module so you can safely call `.clear()` without clearing unrelated app data.
|
|
154
|
+
|
|
155
|
+
Inside your module:
|
|
156
|
+
|
|
157
|
+
```js
|
|
158
|
+
class AwesomeModule {
|
|
159
|
+
constructor(opts) {
|
|
160
|
+
this.cache = new Keyv({
|
|
161
|
+
uri: typeof opts.cache === 'string' && opts.cache,
|
|
162
|
+
store: typeof opts.cache !== 'string' && opts.cache,
|
|
163
|
+
namespace: 'awesome-module'
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Now it can be consumed like this:
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
const AwesomeModule = require('awesome-module');
|
|
173
|
+
|
|
174
|
+
// Caches stuff in memory by default
|
|
175
|
+
const awesomeModule = new AwesomeModule();
|
|
176
|
+
|
|
177
|
+
// After npm install --save keyv-redis
|
|
178
|
+
const awesomeModule = new AwesomeModule({ cache: 'redis://localhost' });
|
|
179
|
+
|
|
180
|
+
// Some third-party module that implements the Map API
|
|
181
|
+
const awesomeModule = new AwesomeModule({ cache: some3rdPartyStore });
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## API
|
|
185
|
+
|
|
186
|
+
### new Keyv([uri], [options])
|
|
187
|
+
|
|
188
|
+
Returns a new Keyv instance.
|
|
189
|
+
|
|
190
|
+
The Keyv instance is also an `EventEmitter` that will emit an `'error'` event if the storage adapter connection fails.
|
|
191
|
+
|
|
192
|
+
### uri
|
|
193
|
+
|
|
194
|
+
Type: `String`<br>
|
|
195
|
+
Default: `undefined`
|
|
196
|
+
|
|
197
|
+
The connection string URI.
|
|
198
|
+
|
|
199
|
+
Merged into the options object as options.uri.
|
|
200
|
+
|
|
201
|
+
### options
|
|
202
|
+
|
|
203
|
+
Type: `Object`
|
|
204
|
+
|
|
205
|
+
The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
|
|
206
|
+
|
|
207
|
+
#### options.namespace
|
|
208
|
+
|
|
209
|
+
Type: `String`<br>
|
|
210
|
+
Default: `'keyv'`
|
|
211
|
+
|
|
212
|
+
Namespace for the current instance.
|
|
213
|
+
|
|
214
|
+
#### options.ttl
|
|
215
|
+
|
|
216
|
+
Type: `Number`<br>
|
|
217
|
+
Default: `undefined`
|
|
218
|
+
|
|
219
|
+
Default TTL. Can be overridden by specififying a TTL on `.set()`.
|
|
220
|
+
|
|
221
|
+
#### options.serialize
|
|
222
|
+
|
|
223
|
+
Type: `Function`<br>
|
|
224
|
+
Default: `JSONB.stringify`
|
|
225
|
+
|
|
226
|
+
A custom serialization function.
|
|
227
|
+
|
|
228
|
+
#### options.deserialize
|
|
229
|
+
|
|
230
|
+
Type: `Function`<br>
|
|
231
|
+
Default: `JSONB.parse`
|
|
232
|
+
|
|
233
|
+
A custom deserialization function.
|
|
234
|
+
|
|
235
|
+
#### options.store
|
|
236
|
+
|
|
237
|
+
Type: `Storage adapter instance`<br>
|
|
238
|
+
Default: `new Map()`
|
|
239
|
+
|
|
240
|
+
The storage adapter instance to be used by Keyv.
|
|
241
|
+
|
|
242
|
+
#### options.adapter
|
|
243
|
+
|
|
244
|
+
Type: `String`<br>
|
|
245
|
+
Default: `undefined`
|
|
246
|
+
|
|
247
|
+
Specify an adapter to use. e.g `'redis'` or `'mongodb'`.
|
|
248
|
+
|
|
249
|
+
### Instance
|
|
250
|
+
|
|
251
|
+
Keys must always be strings. Values can be of any type.
|
|
252
|
+
|
|
253
|
+
#### .set(key, value, [ttl])
|
|
254
|
+
|
|
255
|
+
Set a value.
|
|
256
|
+
|
|
257
|
+
By default keys are persistent. You can set an expiry TTL in milliseconds.
|
|
258
|
+
|
|
259
|
+
Returns a promise which resolves to `true`.
|
|
260
|
+
|
|
261
|
+
#### .get(key, [options])
|
|
262
|
+
|
|
263
|
+
Returns a promise which resolves to the retrieved value.
|
|
264
|
+
|
|
265
|
+
##### options.raw
|
|
266
|
+
|
|
267
|
+
Type: `Boolean`<br>
|
|
268
|
+
Default: `false`
|
|
269
|
+
|
|
270
|
+
If set to true the raw DB object Keyv stores internally will be returned instead of just the value.
|
|
271
|
+
|
|
272
|
+
This contains the TTL timestamp.
|
|
273
|
+
|
|
274
|
+
#### .delete(key)
|
|
275
|
+
|
|
276
|
+
Deletes an entry.
|
|
277
|
+
|
|
278
|
+
Returns a promise which resolves to `true` if the key existed, `false` if not.
|
|
279
|
+
|
|
280
|
+
#### .clear()
|
|
281
|
+
|
|
282
|
+
Delete all entries in the current namespace.
|
|
283
|
+
|
|
284
|
+
Returns a promise which is resolved when the entries have been cleared.
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
MIT © Luke Childs
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "keyv",
|
|
3
|
+
"version": "4.0.3",
|
|
4
|
+
"description": "Simple key-value storage with support for multiple backends",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "xo && nyc ava test/keyv.js",
|
|
8
|
+
"test:full": "xo && nyc ava --serial",
|
|
9
|
+
"coverage": "nyc report --reporter=text-lcov | coveralls"
|
|
10
|
+
},
|
|
11
|
+
"xo": {
|
|
12
|
+
"extends": "xo-lukechilds"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/lukechilds/keyv.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"key",
|
|
20
|
+
"value",
|
|
21
|
+
"store",
|
|
22
|
+
"cache",
|
|
23
|
+
"ttl"
|
|
24
|
+
],
|
|
25
|
+
"author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/lukechilds/keyv/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/lukechilds/keyv",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"json-buffer": "3.0.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"ava": "^2.2.0",
|
|
36
|
+
"coveralls": "^3.0.0",
|
|
37
|
+
"eslint-config-xo-lukechilds": "^1.0.0",
|
|
38
|
+
"@keyv/mongo": "*",
|
|
39
|
+
"@keyv/mysql": "*",
|
|
40
|
+
"@keyv/postgres": "*",
|
|
41
|
+
"@keyv/redis": "*",
|
|
42
|
+
"@keyv/sqlite": "*",
|
|
43
|
+
"@keyv/test-suite": "*",
|
|
44
|
+
"nyc": "^14.1.1",
|
|
45
|
+
"this": "^1.0.2",
|
|
46
|
+
"timekeeper": "^2.0.0",
|
|
47
|
+
"xo": "^0.25.3"
|
|
48
|
+
}
|
|
49
|
+
}
|