@emulsify/cli 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -13
- package/dist/node_modules/.package-lock.json +37 -24
- package/dist/node_modules/@types/node/README.md +5 -6
- package/dist/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/dist/node_modules/@types/node/assert.d.ts +955 -45
- package/dist/node_modules/@types/node/async_hooks.d.ts +391 -87
- package/dist/node_modules/@types/node/buffer.d.ts +2210 -17
- package/dist/node_modules/@types/node/child_process.d.ts +1051 -189
- package/dist/node_modules/@types/node/cluster.d.ts +421 -143
- package/dist/node_modules/@types/node/console.d.ts +359 -49
- package/dist/node_modules/@types/node/constants.d.ts +3 -3
- package/dist/node_modules/@types/node/crypto.d.ts +3528 -291
- package/dist/node_modules/@types/node/dgram.d.ts +446 -30
- package/dist/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/dist/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/dist/node_modules/@types/node/dns.d.ts +588 -240
- package/dist/node_modules/@types/node/dom-events.d.ts +124 -0
- package/dist/node_modules/@types/node/domain.d.ts +159 -16
- package/dist/node_modules/@types/node/events.d.ts +890 -41
- package/dist/node_modules/@types/node/fs/promises.d.ts +980 -369
- package/dist/node_modules/@types/node/fs.d.ts +2599 -869
- package/dist/node_modules/@types/node/globals.d.ts +374 -727
- package/dist/node_modules/@types/node/globals.global.d.ts +1 -1
- package/dist/node_modules/@types/node/http.d.ts +1459 -132
- package/dist/node_modules/@types/node/http2.d.ts +1333 -123
- package/dist/node_modules/@types/node/https.d.ts +289 -13
- package/dist/node_modules/@types/node/index.d.ts +37 -46
- package/dist/node_modules/@types/node/inspector.d.ts +367 -671
- package/dist/node_modules/@types/node/module.d.ts +273 -14
- package/dist/node_modules/@types/node/net.d.ts +741 -66
- package/dist/node_modules/@types/node/os.d.ts +275 -23
- package/dist/node_modules/@types/node/package.json +95 -110
- package/dist/node_modules/@types/node/path.d.ts +27 -4
- package/dist/node_modules/@types/node/perf_hooks.d.ts +756 -125
- package/dist/node_modules/@types/node/process.d.ts +1429 -127
- package/dist/node_modules/@types/node/punycode.d.ts +65 -26
- package/dist/node_modules/@types/node/querystring.d.ts +121 -9
- package/dist/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/dist/node_modules/@types/node/readline.d.ts +405 -49
- package/dist/node_modules/@types/node/repl.d.ts +99 -73
- package/dist/node_modules/@types/node/sea.d.ts +153 -0
- package/dist/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/dist/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/dist/node_modules/@types/node/stream/web.d.ts +367 -0
- package/dist/node_modules/@types/node/stream.d.ts +1462 -273
- package/dist/node_modules/@types/node/string_decoder.d.ts +59 -2
- package/dist/node_modules/@types/node/test.d.ts +1719 -0
- package/dist/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/dist/node_modules/@types/node/timers.d.ts +233 -12
- package/dist/node_modules/@types/node/tls.d.ts +540 -189
- package/dist/node_modules/@types/node/trace_events.d.ts +143 -10
- package/dist/node_modules/@types/node/tty.d.ts +156 -17
- package/dist/node_modules/@types/node/url.d.ts +812 -47
- package/dist/node_modules/@types/node/util.d.ts +2159 -145
- package/dist/node_modules/@types/node/v8.d.ts +693 -74
- package/dist/node_modules/@types/node/vm.d.ts +813 -44
- package/dist/node_modules/@types/node/wasi.d.ts +121 -28
- package/dist/node_modules/@types/node/worker_threads.d.ts +514 -61
- package/dist/node_modules/@types/node/zlib.d.ts +220 -54
- package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +10 -10
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +5 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/uri.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +10 -10
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +5 -5
- package/dist/node_modules/commander/Readme.md +10 -8
- package/dist/node_modules/commander/esm.mjs +1 -1
- package/dist/node_modules/commander/lib/argument.js +9 -5
- package/dist/node_modules/commander/lib/command.js +406 -196
- package/dist/node_modules/commander/lib/error.js +0 -4
- package/dist/node_modules/commander/lib/help.js +101 -38
- package/dist/node_modules/commander/lib/option.js +11 -8
- package/dist/node_modules/commander/lib/suggestSimilar.js +5 -4
- package/dist/node_modules/commander/package.json +23 -19
- package/dist/node_modules/commander/typings/index.d.ts +110 -40
- package/dist/node_modules/debug/package.json +4 -3
- package/dist/node_modules/debug/src/browser.js +3 -1
- package/dist/node_modules/debug/src/node.js +2 -2
- package/dist/node_modules/fast-uri/.gitattributes +2 -0
- package/dist/node_modules/fast-uri/.github/.stale.yml +21 -0
- package/dist/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/dist/node_modules/fast-uri/.github/tests_checker.yml +8 -0
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +23 -0
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +20 -0
- package/dist/node_modules/fast-uri/.taprc +3 -0
- package/dist/node_modules/fast-uri/LICENSE +30 -0
- package/dist/node_modules/fast-uri/README.md +125 -0
- package/dist/node_modules/fast-uri/benchmark.js +105 -0
- package/dist/node_modules/fast-uri/index.js +309 -0
- package/dist/node_modules/fast-uri/lib/schemes.js +188 -0
- package/dist/node_modules/fast-uri/lib/scopedChars.js +30 -0
- package/dist/node_modules/fast-uri/lib/utils.js +242 -0
- package/dist/node_modules/fast-uri/package.json +39 -0
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/ajv.test.js +39 -0
- package/dist/node_modules/fast-uri/test/compatibility.test.js +130 -0
- package/dist/node_modules/fast-uri/test/equal.test.js +104 -0
- package/dist/node_modules/fast-uri/test/parse.test.js +319 -0
- package/dist/node_modules/fast-uri/test/resolve.test.js +76 -0
- package/dist/node_modules/fast-uri/test/serialize.test.js +144 -0
- package/dist/node_modules/fast-uri/test/uri-js.test.js +940 -0
- package/dist/node_modules/fast-uri/test/util.test.js +24 -0
- package/dist/node_modules/fast-uri/types/index.d.ts +53 -0
- package/dist/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/dist/node_modules/fs-extra/README.md +32 -2
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +3 -11
- package/dist/node_modules/fs-extra/lib/copy/copy.js +120 -178
- package/dist/node_modules/fs-extra/lib/copy/index.js +1 -1
- package/dist/node_modules/fs-extra/lib/ensure/file.js +31 -34
- package/dist/node_modules/fs-extra/lib/ensure/link.js +27 -27
- package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +57 -55
- package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +16 -13
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +29 -44
- package/dist/node_modules/fs-extra/lib/esm.mjs +68 -0
- package/dist/node_modules/fs-extra/lib/fs/index.js +29 -17
- package/dist/node_modules/fs-extra/lib/move/index.js +1 -1
- package/dist/node_modules/fs-extra/lib/move/move-sync.js +2 -1
- package/dist/node_modules/fs-extra/lib/move/move.js +38 -54
- package/dist/node_modules/fs-extra/lib/output-file/index.js +10 -19
- package/dist/node_modules/fs-extra/lib/remove/index.js +2 -7
- package/dist/node_modules/fs-extra/lib/util/stat.js +46 -42
- package/dist/node_modules/fs-extra/lib/util/utimes.js +21 -11
- package/dist/node_modules/fs-extra/package.json +11 -7
- package/dist/node_modules/simple-git/dist/cjs/index.js +4958 -0
- package/dist/node_modules/simple-git/dist/cjs/index.js.map +7 -0
- package/dist/node_modules/simple-git/dist/esm/index.js +4813 -0
- package/dist/node_modules/simple-git/dist/esm/index.js.map +7 -0
- package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/api.d.ts +3 -13
- package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
- package/dist/node_modules/simple-git/dist/src/lib/args/pathspec.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-error.d.ts +3 -2
- package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
- package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-list-log-summary.d.ts +2 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-pull.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/completion-detection.plugin.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/index.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/progress-monitor-plugin.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/simple-git-plugin.d.ts +10 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
- package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/FileStatusSummary.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/StatusSummary.d.ts +2 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor-chain.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor.d.ts +3 -4
- package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clone.d.ts +3 -2
- package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/config.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/fetch.d.ts +2 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/log.d.ts +3 -3
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/remote.d.ts +3 -3
- package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
- package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/task.d.ts +1 -1
- package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/types/index.d.ts +64 -5
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/exit-codes.d.ts +1 -0
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/line-parser.d.ts +1 -1
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-parser.d.ts +2 -2
- package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/util.d.ts +3 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/errors.d.ts +0 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/index.d.ts +2 -1
- package/dist/node_modules/simple-git/{typings → dist/typings}/response.d.ts +68 -25
- package/dist/node_modules/simple-git/{typings → dist/typings}/simple-git.d.ts +493 -110
- package/dist/node_modules/simple-git/dist/typings/types.d.ts +23 -0
- package/dist/node_modules/simple-git/package.json +32 -35
- package/dist/node_modules/simple-git/promise.js +14 -4
- package/dist/node_modules/simple-git/readme.md +372 -389
- package/dist/node_modules/undici-types/README.md +6 -0
- package/dist/node_modules/undici-types/agent.d.ts +31 -0
- package/dist/node_modules/undici-types/api.d.ts +43 -0
- package/dist/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/dist/node_modules/undici-types/cache.d.ts +36 -0
- package/dist/node_modules/undici-types/client.d.ts +97 -0
- package/dist/node_modules/undici-types/connector.d.ts +34 -0
- package/dist/node_modules/undici-types/content-type.d.ts +21 -0
- package/dist/node_modules/undici-types/cookies.d.ts +28 -0
- package/dist/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/dist/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/dist/node_modules/undici-types/errors.d.ts +128 -0
- package/dist/node_modules/undici-types/fetch.d.ts +209 -0
- package/dist/node_modules/undici-types/file.d.ts +39 -0
- package/dist/node_modules/undici-types/filereader.d.ts +54 -0
- package/dist/node_modules/undici-types/formdata.d.ts +108 -0
- package/dist/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/dist/node_modules/undici-types/global-origin.d.ts +7 -0
- package/dist/node_modules/undici-types/handlers.d.ts +9 -0
- package/dist/node_modules/undici-types/header.d.ts +4 -0
- package/dist/node_modules/undici-types/index.d.ts +63 -0
- package/dist/node_modules/undici-types/interceptors.d.ts +5 -0
- package/dist/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/dist/node_modules/undici-types/mock-client.d.ts +25 -0
- package/dist/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/dist/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/dist/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/dist/node_modules/undici-types/package.json +55 -0
- package/dist/node_modules/undici-types/patch.d.ts +71 -0
- package/dist/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/dist/node_modules/undici-types/pool.d.ts +28 -0
- package/dist/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/dist/node_modules/undici-types/readable.d.ts +61 -0
- package/dist/node_modules/undici-types/webidl.d.ts +220 -0
- package/dist/node_modules/undici-types/websocket.d.ts +131 -0
- package/dist/package-lock.json +10146 -0
- package/dist/package.json +23 -23
- package/dist/schemas/variant.json +5 -21
- package/package.json +24 -24
- package/dist/node_modules/@types/node/ts4.8/assert.d.ts +0 -130
- package/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -237
- package/dist/node_modules/@types/node/ts4.8/buffer.d.ts +0 -89
- package/dist/node_modules/@types/node/ts4.8/child_process.d.ts +0 -682
- package/dist/node_modules/@types/node/ts4.8/cluster.d.ts +0 -300
- package/dist/node_modules/@types/node/ts4.8/console.d.ts +0 -142
- package/dist/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/dist/node_modules/@types/node/ts4.8/crypto.d.ts +0 -1287
- package/dist/node_modules/@types/node/ts4.8/dgram.d.ts +0 -180
- package/dist/node_modules/@types/node/ts4.8/dns.d.ts +0 -516
- package/dist/node_modules/@types/node/ts4.8/domain.d.ts +0 -27
- package/dist/node_modules/@types/node/ts4.8/events.d.ts +0 -82
- package/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -634
- package/dist/node_modules/@types/node/ts4.8/fs.d.ts +0 -2587
- package/dist/node_modules/@types/node/ts4.8/globals.d.ts +0 -763
- package/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/dist/node_modules/@types/node/ts4.8/http.d.ts +0 -580
- package/dist/node_modules/@types/node/ts4.8/http2.d.ts +0 -1208
- package/dist/node_modules/@types/node/ts4.8/https.d.ts +0 -274
- package/dist/node_modules/@types/node/ts4.8/index.d.ts +0 -53
- package/dist/node_modules/@types/node/ts4.8/inspector.d.ts +0 -3050
- package/dist/node_modules/@types/node/ts4.8/module.d.ts +0 -56
- package/dist/node_modules/@types/node/ts4.8/net.d.ts +0 -324
- package/dist/node_modules/@types/node/ts4.8/os.d.ts +0 -243
- package/dist/node_modules/@types/node/ts4.8/path.d.ts +0 -168
- package/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -274
- package/dist/node_modules/@types/node/ts4.8/process.d.ts +0 -452
- package/dist/node_modules/@types/node/ts4.8/punycode.d.ts +0 -78
- package/dist/node_modules/@types/node/ts4.8/querystring.d.ts +0 -41
- package/dist/node_modules/@types/node/ts4.8/readline.d.ts +0 -184
- package/dist/node_modules/@types/node/ts4.8/repl.d.ts +0 -404
- package/dist/node_modules/@types/node/ts4.8/stream.d.ts +0 -518
- package/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -10
- package/dist/node_modules/@types/node/ts4.8/timers.d.ts +0 -19
- package/dist/node_modules/@types/node/ts4.8/tls.d.ts +0 -866
- package/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -64
- package/dist/node_modules/@types/node/ts4.8/tty.d.ts +0 -69
- package/dist/node_modules/@types/node/ts4.8/url.d.ts +0 -187
- package/dist/node_modules/@types/node/ts4.8/util.d.ts +0 -278
- package/dist/node_modules/@types/node/ts4.8/v8.d.ts +0 -189
- package/dist/node_modules/@types/node/ts4.8/vm.d.ts +0 -155
- package/dist/node_modules/@types/node/ts4.8/wasi.d.ts +0 -88
- package/dist/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -241
- package/dist/node_modules/@types/node/ts4.8/zlib.d.ts +0 -364
- package/dist/node_modules/fs-extra/lib/remove/rimraf.js +0 -302
- package/dist/node_modules/simple-git/CHANGELOG.md +0 -529
- package/dist/node_modules/simple-git/LICENSE +0 -20
- package/dist/node_modules/simple-git/promise.d.ts +0 -46
- package/dist/node_modules/simple-git/src/git.js +0 -700
- package/dist/node_modules/simple-git/src/index.js +0 -7
- package/dist/node_modules/simple-git/src/lib/api.js +0 -26
- package/dist/node_modules/simple-git/src/lib/api.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js +0 -21
- package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-error.js +0 -37
- package/dist/node_modules/simple-git/src/lib/errors/git-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.d.ts +0 -6
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js +0 -14
- package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js +0 -36
- package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js +0 -19
- package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/git-factory.d.ts +0 -25
- package/dist/node_modules/simple-git/src/lib/git-factory.js +0 -45
- package/dist/node_modules/simple-git/src/lib/git-factory.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/git-logger.js +0 -101
- package/dist/node_modules/simple-git/src/lib/git-logger.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js +0 -29
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js +0 -18
- package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js +0 -53
- package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.d.ts +0 -2
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js +0 -74
- package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js +0 -32
- package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js +0 -35
- package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js +0 -39
- package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js +0 -14
- package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js +0 -42
- package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js +0 -58
- package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js +0 -33
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js +0 -41
- package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js +0 -15
- package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js +0 -80
- package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js +0 -39
- package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/index.js +0 -21
- package/dist/node_modules/simple-git/src/lib/plugins/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.d.ts +0 -6
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js +0 -28
- package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js +0 -45
- package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js +0 -3
- package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js +0 -15
- package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js +0 -37
- package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js +0 -31
- package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.d.ts +0 -10
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js +0 -26
- package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js +0 -13
- package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js +0 -28
- package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js +0 -89
- package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js +0 -16
- package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js +0 -18
- package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js +0 -30
- package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js +0 -36
- package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js +0 -35
- package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.d.ts +0 -12
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js +0 -22
- package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js +0 -128
- package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/responses/TagList.js +0 -56
- package/dist/node_modules/simple-git/src/lib/responses/TagList.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js +0 -173
- package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/git-executor.js +0 -21
- package/dist/node_modules/simple-git/src/lib/runners/git-executor.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js +0 -133
- package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/scheduler.js +0 -48
- package/dist/node_modules/simple-git/src/lib/runners/scheduler.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js +0 -64
- package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/simple-git-api.js +0 -80
- package/dist/node_modules/simple-git/src/lib/simple-git-api.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/task-callback.js +0 -39
- package/dist/node_modules/simple-git/src/lib/task-callback.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js +0 -9
- package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/branch.js +0 -76
- package/dist/node_modules/simple-git/src/lib/tasks/branch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js +0 -13
- package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js +0 -61
- package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/clean.js +0 -85
- package/dist/node_modules/simple-git/src/lib/tasks/clean.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/clone.js +0 -22
- package/dist/node_modules/simple-git/src/lib/tasks/clone.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/commit.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/commit.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/commit.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/config.js +0 -73
- package/dist/node_modules/simple-git/src/lib/tasks/config.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/diff.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/diff.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/diff.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/fetch.js +0 -17
- package/dist/node_modules/simple-git/src/lib/tasks/fetch.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/grep.js +0 -76
- package/dist/node_modules/simple-git/src/lib/tasks/grep.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/init.js +0 -23
- package/dist/node_modules/simple-git/src/lib/tasks/init.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/log.js +0 -109
- package/dist/node_modules/simple-git/src/lib/tasks/log.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/merge.js +0 -24
- package/dist/node_modules/simple-git/src/lib/tasks/merge.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/move.js +0 -14
- package/dist/node_modules/simple-git/src/lib/tasks/move.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/pull.js +0 -19
- package/dist/node_modules/simple-git/src/lib/tasks/pull.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/push.js +0 -29
- package/dist/node_modules/simple-git/src/lib/tasks/push.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/remote.js +0 -42
- package/dist/node_modules/simple-git/src/lib/tasks/remote.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/reset.js +0 -38
- package/dist/node_modules/simple-git/src/lib/tasks/reset.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.d.ts +0 -3
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js +0 -16
- package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/status.js +0 -15
- package/dist/node_modules/simple-git/src/lib/tasks/status.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js +0 -25
- package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/tag.js +0 -45
- package/dist/node_modules/simple-git/src/lib/tasks/tag.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/tasks/task.js +0 -52
- package/dist/node_modules/simple-git/src/lib/tasks/task.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/handlers.js +0 -3
- package/dist/node_modules/simple-git/src/lib/types/handlers.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/index.js +0 -15
- package/dist/node_modules/simple-git/src/lib/types/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/types/tasks.js +0 -3
- package/dist/node_modules/simple-git/src/lib/types/tasks.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js +0 -47
- package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js +0 -14
- package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js +0 -14
- package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/index.js +0 -21
- package/dist/node_modules/simple-git/src/lib/utils/index.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/line-parser.js +0 -52
- package/dist/node_modules/simple-git/src/lib/utils/line-parser.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js +0 -16
- package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/task-options.js +0 -58
- package/dist/node_modules/simple-git/src/lib/utils/task-options.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/task-parser.js +0 -24
- package/dist/node_modules/simple-git/src/lib/utils/task-parser.js.map +0 -1
- package/dist/node_modules/simple-git/src/lib/utils/util.js +0 -146
- package/dist/node_modules/simple-git/src/lib/utils/util.js.map +0 -1
- package/dist/node_modules/simple-git/typings/types.d.ts +0 -14
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-construct-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-response-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/task-configuration-error.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/git-logger.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch-delete.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-commit.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-fetch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-merge.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-move.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-push.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-messages.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-objects.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/command-config-prefixing-plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/error-detection.plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/spawn-options-plugin.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/BranchDeleteSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CheckIgnore.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CleanSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/ConfigList.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/DiffSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/GetRemoteSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/InitSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/MergeSummary.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/TagList.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/promise-wrapped.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/scheduler.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/tasks-pending-queue.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/simple-git-api.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/task-callback.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/apply-patch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/branch.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/change-working-directory.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-ignore.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-is-repo.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clean.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/grep.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/hash-object.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/init.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/merge.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/move.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/pull.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/push.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/reset.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/status.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/sub-module.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/tag.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/handlers.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/tasks.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/argument-filters.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/git-output-streams.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/index.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/simple-git-options.d.ts +0 -0
- /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-options.d.ts +0 -0
|
@@ -1,27 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > Stability: 2 - Stable
|
|
3
|
+
*
|
|
4
|
+
* The `node:net` module provides an asynchronous network API for creating stream-based
|
|
5
|
+
* TCP or `IPC` servers ({@link createServer}) and clients
|
|
6
|
+
* ({@link createConnection}).
|
|
7
|
+
*
|
|
8
|
+
* It can be accessed using:
|
|
9
|
+
*
|
|
10
|
+
* ```js
|
|
11
|
+
* const net = require('node:net');
|
|
12
|
+
* ```
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/net.js)
|
|
14
|
+
*/
|
|
1
15
|
declare module "net" {
|
|
2
|
-
import * as stream from "stream";
|
|
3
|
-
import EventEmitter
|
|
4
|
-
import * as dns from "dns";
|
|
5
|
-
|
|
16
|
+
import * as stream from "node:stream";
|
|
17
|
+
import { Abortable, EventEmitter } from "node:events";
|
|
18
|
+
import * as dns from "node:dns";
|
|
6
19
|
type LookupFunction = (
|
|
7
20
|
hostname: string,
|
|
8
|
-
options: dns.
|
|
9
|
-
callback: (err: NodeJS.ErrnoException | null, address: string, family
|
|
21
|
+
options: dns.LookupOptions,
|
|
22
|
+
callback: (err: NodeJS.ErrnoException | null, address: string | dns.LookupAddress[], family?: number) => void,
|
|
10
23
|
) => void;
|
|
11
|
-
|
|
12
24
|
interface AddressInfo {
|
|
13
25
|
address: string;
|
|
14
26
|
family: string;
|
|
15
27
|
port: number;
|
|
16
28
|
}
|
|
17
|
-
|
|
18
29
|
interface SocketConstructorOpts {
|
|
19
30
|
fd?: number | undefined;
|
|
20
31
|
allowHalfOpen?: boolean | undefined;
|
|
21
32
|
readable?: boolean | undefined;
|
|
22
33
|
writable?: boolean | undefined;
|
|
34
|
+
signal?: AbortSignal;
|
|
23
35
|
}
|
|
24
|
-
|
|
25
36
|
interface OnReadOpts {
|
|
26
37
|
buffer: Uint8Array | (() => Uint8Array);
|
|
27
38
|
/**
|
|
@@ -31,7 +42,6 @@ declare module "net" {
|
|
|
31
42
|
*/
|
|
32
43
|
callback(bytesWritten: number, buf: Uint8Array): boolean;
|
|
33
44
|
}
|
|
34
|
-
|
|
35
45
|
interface ConnectOpts {
|
|
36
46
|
/**
|
|
37
47
|
* If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
|
|
@@ -40,7 +50,6 @@ declare module "net" {
|
|
|
40
50
|
*/
|
|
41
51
|
onread?: OnReadOpts | undefined;
|
|
42
52
|
}
|
|
43
|
-
|
|
44
53
|
interface TcpSocketConnectOpts extends ConnectOpts {
|
|
45
54
|
port: number;
|
|
46
55
|
host?: string | undefined;
|
|
@@ -49,80 +58,334 @@ declare module "net" {
|
|
|
49
58
|
hints?: number | undefined;
|
|
50
59
|
family?: number | undefined;
|
|
51
60
|
lookup?: LookupFunction | undefined;
|
|
61
|
+
noDelay?: boolean | undefined;
|
|
62
|
+
keepAlive?: boolean | undefined;
|
|
63
|
+
keepAliveInitialDelay?: number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* @since v18.13.0
|
|
66
|
+
*/
|
|
67
|
+
autoSelectFamily?: boolean | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* @since v18.13.0
|
|
70
|
+
*/
|
|
71
|
+
autoSelectFamilyAttemptTimeout?: number | undefined;
|
|
52
72
|
}
|
|
53
|
-
|
|
54
73
|
interface IpcSocketConnectOpts extends ConnectOpts {
|
|
55
74
|
path: string;
|
|
56
75
|
}
|
|
57
|
-
|
|
58
76
|
type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
|
59
77
|
type SocketReadyState = "opening" | "open" | "readOnly" | "writeOnly" | "closed";
|
|
60
|
-
|
|
78
|
+
/**
|
|
79
|
+
* This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
|
|
80
|
+
* (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
|
|
81
|
+
* an `EventEmitter`.
|
|
82
|
+
*
|
|
83
|
+
* A `net.Socket` can be created by the user and used directly to interact with
|
|
84
|
+
* a server. For example, it is returned by {@link createConnection},
|
|
85
|
+
* so the user can use it to talk to the server.
|
|
86
|
+
*
|
|
87
|
+
* It can also be created by Node.js and passed to the user when a connection
|
|
88
|
+
* is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use
|
|
89
|
+
* it to interact with the client.
|
|
90
|
+
* @since v0.3.4
|
|
91
|
+
*/
|
|
61
92
|
class Socket extends stream.Duplex {
|
|
62
93
|
constructor(options?: SocketConstructorOpts);
|
|
63
|
-
|
|
64
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Destroys the socket after all data is written. If the `finish` event was already emitted the socket is destroyed immediately.
|
|
96
|
+
* If the socket is still writable it implicitly calls `socket.end()`.
|
|
97
|
+
* @since v0.3.4
|
|
98
|
+
*/
|
|
99
|
+
destroySoon(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Sends data on the socket. The second parameter specifies the encoding in the
|
|
102
|
+
* case of a string. It defaults to UTF8 encoding.
|
|
103
|
+
*
|
|
104
|
+
* Returns `true` if the entire data was flushed successfully to the kernel
|
|
105
|
+
* buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free.
|
|
106
|
+
*
|
|
107
|
+
* The optional `callback` parameter will be executed when the data is finally
|
|
108
|
+
* written out, which may not be immediately.
|
|
109
|
+
*
|
|
110
|
+
* See `Writable` stream `write()` method for more
|
|
111
|
+
* information.
|
|
112
|
+
* @since v0.1.90
|
|
113
|
+
* @param [encoding='utf8'] Only used when data is `string`.
|
|
114
|
+
*/
|
|
65
115
|
write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
|
|
66
116
|
write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
|
|
67
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Initiate a connection on a given socket.
|
|
119
|
+
*
|
|
120
|
+
* Possible signatures:
|
|
121
|
+
*
|
|
122
|
+
* * `socket.connect(options[, connectListener])`
|
|
123
|
+
* * `socket.connect(path[, connectListener])` for `IPC` connections.
|
|
124
|
+
* * `socket.connect(port[, host][, connectListener])` for TCP connections.
|
|
125
|
+
* * Returns: `net.Socket` The socket itself.
|
|
126
|
+
*
|
|
127
|
+
* This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting,
|
|
128
|
+
* instead of a `'connect'` event, an `'error'` event will be emitted with
|
|
129
|
+
* the error passed to the `'error'` listener.
|
|
130
|
+
* The last parameter `connectListener`, if supplied, will be added as a listener
|
|
131
|
+
* for the `'connect'` event **once**.
|
|
132
|
+
*
|
|
133
|
+
* This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined
|
|
134
|
+
* behavior.
|
|
135
|
+
*/
|
|
68
136
|
connect(options: SocketConnectOpts, connectionListener?: () => void): this;
|
|
69
137
|
connect(port: number, host: string, connectionListener?: () => void): this;
|
|
70
138
|
connect(port: number, connectionListener?: () => void): this;
|
|
71
139
|
connect(path: string, connectionListener?: () => void): this;
|
|
72
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information.
|
|
142
|
+
* @since v0.1.90
|
|
143
|
+
* @return The socket itself.
|
|
144
|
+
*/
|
|
73
145
|
setEncoding(encoding?: BufferEncoding): this;
|
|
146
|
+
/**
|
|
147
|
+
* Pauses the reading of data. That is, `'data'` events will not be emitted.
|
|
148
|
+
* Useful to throttle back an upload.
|
|
149
|
+
* @return The socket itself.
|
|
150
|
+
*/
|
|
74
151
|
pause(): this;
|
|
152
|
+
/**
|
|
153
|
+
* Close the TCP connection by sending an RST packet and destroy the stream.
|
|
154
|
+
* If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected.
|
|
155
|
+
* Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error.
|
|
156
|
+
* If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error.
|
|
157
|
+
* @since v18.3.0, v16.17.0
|
|
158
|
+
*/
|
|
159
|
+
resetAndDestroy(): this;
|
|
160
|
+
/**
|
|
161
|
+
* Resumes reading after a call to `socket.pause()`.
|
|
162
|
+
* @return The socket itself.
|
|
163
|
+
*/
|
|
75
164
|
resume(): this;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the socket to timeout after `timeout` milliseconds of inactivity on
|
|
167
|
+
* the socket. By default `net.Socket` do not have a timeout.
|
|
168
|
+
*
|
|
169
|
+
* When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to
|
|
170
|
+
* end the connection.
|
|
171
|
+
*
|
|
172
|
+
* ```js
|
|
173
|
+
* socket.setTimeout(3000);
|
|
174
|
+
* socket.on('timeout', () => {
|
|
175
|
+
* console.log('socket timeout');
|
|
176
|
+
* socket.end();
|
|
177
|
+
* });
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* If `timeout` is 0, then the existing idle timeout is disabled.
|
|
181
|
+
*
|
|
182
|
+
* The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event.
|
|
183
|
+
* @since v0.1.90
|
|
184
|
+
* @return The socket itself.
|
|
185
|
+
*/
|
|
76
186
|
setTimeout(timeout: number, callback?: () => void): this;
|
|
187
|
+
/**
|
|
188
|
+
* Enable/disable the use of Nagle's algorithm.
|
|
189
|
+
*
|
|
190
|
+
* When a TCP connection is created, it will have Nagle's algorithm enabled.
|
|
191
|
+
*
|
|
192
|
+
* Nagle's algorithm delays data before it is sent via the network. It attempts
|
|
193
|
+
* to optimize throughput at the expense of latency.
|
|
194
|
+
*
|
|
195
|
+
* Passing `true` for `noDelay` or not passing an argument will disable Nagle's
|
|
196
|
+
* algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's
|
|
197
|
+
* algorithm.
|
|
198
|
+
* @since v0.1.90
|
|
199
|
+
* @param [noDelay=true]
|
|
200
|
+
* @return The socket itself.
|
|
201
|
+
*/
|
|
77
202
|
setNoDelay(noDelay?: boolean): this;
|
|
203
|
+
/**
|
|
204
|
+
* Enable/disable keep-alive functionality, and optionally set the initial
|
|
205
|
+
* delay before the first keepalive probe is sent on an idle socket.
|
|
206
|
+
*
|
|
207
|
+
* Set `initialDelay` (in milliseconds) to set the delay between the last
|
|
208
|
+
* data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default
|
|
209
|
+
* (or previous) setting.
|
|
210
|
+
*
|
|
211
|
+
* Enabling the keep-alive functionality will set the following socket options:
|
|
212
|
+
*
|
|
213
|
+
* * `SO_KEEPALIVE=1`
|
|
214
|
+
* * `TCP_KEEPIDLE=initialDelay`
|
|
215
|
+
* * `TCP_KEEPCNT=10`
|
|
216
|
+
* * `TCP_KEEPINTVL=1`
|
|
217
|
+
* @since v0.1.92
|
|
218
|
+
* @param [enable=false]
|
|
219
|
+
* @param [initialDelay=0]
|
|
220
|
+
* @return The socket itself.
|
|
221
|
+
*/
|
|
78
222
|
setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
|
223
|
+
/**
|
|
224
|
+
* Returns the bound `address`, the address `family` name and `port` of the
|
|
225
|
+
* socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
|
|
226
|
+
* @since v0.1.90
|
|
227
|
+
*/
|
|
79
228
|
address(): AddressInfo | {};
|
|
229
|
+
/**
|
|
230
|
+
* Calling `unref()` on a socket will allow the program to exit if this is the only
|
|
231
|
+
* active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect.
|
|
232
|
+
* @since v0.9.1
|
|
233
|
+
* @return The socket itself.
|
|
234
|
+
*/
|
|
80
235
|
unref(): this;
|
|
236
|
+
/**
|
|
237
|
+
* Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior).
|
|
238
|
+
* If the socket is `ref`ed calling `ref` again will have no effect.
|
|
239
|
+
* @since v0.9.1
|
|
240
|
+
* @return The socket itself.
|
|
241
|
+
*/
|
|
81
242
|
ref(): this;
|
|
82
|
-
|
|
83
|
-
|
|
243
|
+
/**
|
|
244
|
+
* This property is only present if the family autoselection algorithm is enabled in `socket.connect(options)`
|
|
245
|
+
* and it is an array of the addresses that have been attempted.
|
|
246
|
+
*
|
|
247
|
+
* Each address is a string in the form of `$IP:$PORT`.
|
|
248
|
+
* If the connection was successful, then the last address is the one that the socket is currently connected to.
|
|
249
|
+
* @since v19.4.0
|
|
250
|
+
*/
|
|
251
|
+
readonly autoSelectFamilyAttemptedAddresses: string[];
|
|
252
|
+
/**
|
|
253
|
+
* This property shows the number of characters buffered for writing. The buffer
|
|
254
|
+
* may contain strings whose length after encoding is not yet known. So this number
|
|
255
|
+
* is only an approximation of the number of bytes in the buffer.
|
|
256
|
+
*
|
|
257
|
+
* `net.Socket` has the property that `socket.write()` always works. This is to
|
|
258
|
+
* help users get up and running quickly. The computer cannot always keep up
|
|
259
|
+
* with the amount of data that is written to a socket. The network connection
|
|
260
|
+
* simply might be too slow. Node.js will internally queue up the data written to a
|
|
261
|
+
* socket and send it out over the wire when it is possible.
|
|
262
|
+
*
|
|
263
|
+
* The consequence of this internal buffering is that memory may grow.
|
|
264
|
+
* Users who experience large or growing `bufferSize` should attempt to
|
|
265
|
+
* "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`.
|
|
266
|
+
* @since v0.3.8
|
|
267
|
+
* @deprecated Since v14.6.0 - Use `writableLength` instead.
|
|
268
|
+
*/
|
|
84
269
|
readonly bufferSize: number;
|
|
270
|
+
/**
|
|
271
|
+
* The amount of received bytes.
|
|
272
|
+
* @since v0.5.3
|
|
273
|
+
*/
|
|
85
274
|
readonly bytesRead: number;
|
|
275
|
+
/**
|
|
276
|
+
* The amount of bytes sent.
|
|
277
|
+
* @since v0.5.3
|
|
278
|
+
*/
|
|
86
279
|
readonly bytesWritten: number;
|
|
280
|
+
/**
|
|
281
|
+
* If `true`, `socket.connect(options[, connectListener])` was
|
|
282
|
+
* called and has not yet finished. It will stay `true` until the socket becomes
|
|
283
|
+
* connected, then it is set to `false` and the `'connect'` event is emitted. Note
|
|
284
|
+
* that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event.
|
|
285
|
+
* @since v6.1.0
|
|
286
|
+
*/
|
|
87
287
|
readonly connecting: boolean;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
288
|
+
/**
|
|
289
|
+
* This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting
|
|
290
|
+
* (see `socket.connecting`).
|
|
291
|
+
* @since v11.2.0, v10.16.0
|
|
292
|
+
*/
|
|
91
293
|
readonly pending: boolean;
|
|
294
|
+
/**
|
|
295
|
+
* See `writable.destroyed` for further details.
|
|
296
|
+
*/
|
|
297
|
+
readonly destroyed: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* The string representation of the local IP address the remote client is
|
|
300
|
+
* connecting on. For example, in a server listening on `'0.0.0.0'`, if a client
|
|
301
|
+
* connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`.
|
|
302
|
+
* @since v0.9.6
|
|
303
|
+
*/
|
|
304
|
+
readonly localAddress?: string;
|
|
305
|
+
/**
|
|
306
|
+
* The numeric representation of the local port. For example, `80` or `21`.
|
|
307
|
+
* @since v0.9.6
|
|
308
|
+
*/
|
|
309
|
+
readonly localPort?: number;
|
|
310
|
+
/**
|
|
311
|
+
* The string representation of the local IP family. `'IPv4'` or `'IPv6'`.
|
|
312
|
+
* @since v18.8.0, v16.18.0
|
|
313
|
+
*/
|
|
314
|
+
readonly localFamily?: string;
|
|
92
315
|
/**
|
|
93
316
|
* This property represents the state of the connection as a string.
|
|
94
|
-
*
|
|
317
|
+
*
|
|
318
|
+
* * If the stream is connecting `socket.readyState` is `opening`.
|
|
319
|
+
* * If the stream is readable and writable, it is `open`.
|
|
320
|
+
* * If the stream is readable and not writable, it is `readOnly`.
|
|
321
|
+
* * If the stream is not readable and writable, it is `writeOnly`.
|
|
95
322
|
* @since v0.5.0
|
|
96
323
|
*/
|
|
97
324
|
readonly readyState: SocketReadyState;
|
|
325
|
+
/**
|
|
326
|
+
* The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if
|
|
327
|
+
* the socket is destroyed (for example, if the client disconnected).
|
|
328
|
+
* @since v0.5.10
|
|
329
|
+
*/
|
|
98
330
|
readonly remoteAddress?: string | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if
|
|
333
|
+
* the socket is destroyed (for example, if the client disconnected).
|
|
334
|
+
* @since v0.11.14
|
|
335
|
+
*/
|
|
99
336
|
readonly remoteFamily?: string | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if
|
|
339
|
+
* the socket is destroyed (for example, if the client disconnected).
|
|
340
|
+
* @since v0.5.10
|
|
341
|
+
*/
|
|
100
342
|
readonly remotePort?: number | undefined;
|
|
101
343
|
/**
|
|
102
|
-
* The socket timeout in milliseconds as set by socket.setTimeout()
|
|
344
|
+
* The socket timeout in milliseconds as set by `socket.setTimeout()`.
|
|
345
|
+
* It is `undefined` if a timeout has not been set.
|
|
103
346
|
* @since v10.7.0
|
|
104
347
|
*/
|
|
105
348
|
readonly timeout?: number | undefined;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
349
|
+
/**
|
|
350
|
+
* Half-closes the socket. i.e., it sends a FIN packet. It is possible the
|
|
351
|
+
* server will still send some data.
|
|
352
|
+
*
|
|
353
|
+
* See `writable.end()` for further details.
|
|
354
|
+
* @since v0.1.90
|
|
355
|
+
* @param [encoding='utf8'] Only used when data is `string`.
|
|
356
|
+
* @param callback Optional callback for when the socket is finished.
|
|
357
|
+
* @return The socket itself.
|
|
358
|
+
*/
|
|
359
|
+
end(callback?: () => void): this;
|
|
360
|
+
end(buffer: Uint8Array | string, callback?: () => void): this;
|
|
361
|
+
end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
|
|
112
362
|
/**
|
|
113
363
|
* events.EventEmitter
|
|
114
364
|
* 1. close
|
|
115
365
|
* 2. connect
|
|
116
|
-
* 3.
|
|
117
|
-
* 4.
|
|
118
|
-
* 5.
|
|
119
|
-
* 6.
|
|
120
|
-
* 7.
|
|
121
|
-
* 8.
|
|
366
|
+
* 3. connectionAttempt
|
|
367
|
+
* 4. connectionAttemptFailed
|
|
368
|
+
* 5. connectionAttemptTimeout
|
|
369
|
+
* 6. data
|
|
370
|
+
* 7. drain
|
|
371
|
+
* 8. end
|
|
372
|
+
* 9. error
|
|
373
|
+
* 10. lookup
|
|
374
|
+
* 11. ready
|
|
375
|
+
* 12. timeout
|
|
122
376
|
*/
|
|
123
377
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
124
|
-
addListener(event: "close", listener: (
|
|
378
|
+
addListener(event: "close", listener: (hadError: boolean) => void): this;
|
|
125
379
|
addListener(event: "connect", listener: () => void): this;
|
|
380
|
+
addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
381
|
+
addListener(
|
|
382
|
+
event: "connectionAttemptFailed",
|
|
383
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
384
|
+
): this;
|
|
385
|
+
addListener(
|
|
386
|
+
event: "connectionAttemptTimeout",
|
|
387
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
388
|
+
): this;
|
|
126
389
|
addListener(event: "data", listener: (data: Buffer) => void): this;
|
|
127
390
|
addListener(event: "drain", listener: () => void): this;
|
|
128
391
|
addListener(event: "end", listener: () => void): this;
|
|
@@ -133,10 +396,12 @@ declare module "net" {
|
|
|
133
396
|
): this;
|
|
134
397
|
addListener(event: "ready", listener: () => void): this;
|
|
135
398
|
addListener(event: "timeout", listener: () => void): this;
|
|
136
|
-
|
|
137
399
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
138
|
-
emit(event: "close",
|
|
400
|
+
emit(event: "close", hadError: boolean): boolean;
|
|
139
401
|
emit(event: "connect"): boolean;
|
|
402
|
+
emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
|
|
403
|
+
emit(event: "connectionAttemptFailed", ip: string, port: number, family: number): boolean;
|
|
404
|
+
emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
|
|
140
405
|
emit(event: "data", data: Buffer): boolean;
|
|
141
406
|
emit(event: "drain"): boolean;
|
|
142
407
|
emit(event: "end"): boolean;
|
|
@@ -144,10 +409,12 @@ declare module "net" {
|
|
|
144
409
|
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
|
145
410
|
emit(event: "ready"): boolean;
|
|
146
411
|
emit(event: "timeout"): boolean;
|
|
147
|
-
|
|
148
412
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
149
|
-
on(event: "close", listener: (
|
|
413
|
+
on(event: "close", listener: (hadError: boolean) => void): this;
|
|
150
414
|
on(event: "connect", listener: () => void): this;
|
|
415
|
+
on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
416
|
+
on(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
|
|
417
|
+
on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
151
418
|
on(event: "data", listener: (data: Buffer) => void): this;
|
|
152
419
|
on(event: "drain", listener: () => void): this;
|
|
153
420
|
on(event: "end", listener: () => void): this;
|
|
@@ -158,9 +425,11 @@ declare module "net" {
|
|
|
158
425
|
): this;
|
|
159
426
|
on(event: "ready", listener: () => void): this;
|
|
160
427
|
on(event: "timeout", listener: () => void): this;
|
|
161
|
-
|
|
162
428
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
163
|
-
once(event: "close", listener: (
|
|
429
|
+
once(event: "close", listener: (hadError: boolean) => void): this;
|
|
430
|
+
once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
431
|
+
once(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
|
|
432
|
+
once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
|
|
164
433
|
once(event: "connect", listener: () => void): this;
|
|
165
434
|
once(event: "data", listener: (data: Buffer) => void): this;
|
|
166
435
|
once(event: "drain", listener: () => void): this;
|
|
@@ -172,10 +441,18 @@ declare module "net" {
|
|
|
172
441
|
): this;
|
|
173
442
|
once(event: "ready", listener: () => void): this;
|
|
174
443
|
once(event: "timeout", listener: () => void): this;
|
|
175
|
-
|
|
176
444
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
177
|
-
prependListener(event: "close", listener: (
|
|
445
|
+
prependListener(event: "close", listener: (hadError: boolean) => void): this;
|
|
178
446
|
prependListener(event: "connect", listener: () => void): this;
|
|
447
|
+
prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
|
|
448
|
+
prependListener(
|
|
449
|
+
event: "connectionAttemptFailed",
|
|
450
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
451
|
+
): this;
|
|
452
|
+
prependListener(
|
|
453
|
+
event: "connectionAttemptTimeout",
|
|
454
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
455
|
+
): this;
|
|
179
456
|
prependListener(event: "data", listener: (data: Buffer) => void): this;
|
|
180
457
|
prependListener(event: "drain", listener: () => void): this;
|
|
181
458
|
prependListener(event: "end", listener: () => void): this;
|
|
@@ -186,10 +463,21 @@ declare module "net" {
|
|
|
186
463
|
): this;
|
|
187
464
|
prependListener(event: "ready", listener: () => void): this;
|
|
188
465
|
prependListener(event: "timeout", listener: () => void): this;
|
|
189
|
-
|
|
190
466
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
191
|
-
prependOnceListener(event: "close", listener: (
|
|
467
|
+
prependOnceListener(event: "close", listener: (hadError: boolean) => void): this;
|
|
192
468
|
prependOnceListener(event: "connect", listener: () => void): this;
|
|
469
|
+
prependOnceListener(
|
|
470
|
+
event: "connectionAttempt",
|
|
471
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
472
|
+
): this;
|
|
473
|
+
prependOnceListener(
|
|
474
|
+
event: "connectionAttemptFailed",
|
|
475
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
476
|
+
): this;
|
|
477
|
+
prependOnceListener(
|
|
478
|
+
event: "connectionAttemptTimeout",
|
|
479
|
+
listener: (ip: string, port: number, family: number) => void,
|
|
480
|
+
): this;
|
|
193
481
|
prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
|
|
194
482
|
prependOnceListener(event: "drain", listener: () => void): this;
|
|
195
483
|
prependOnceListener(event: "end", listener: () => void): this;
|
|
@@ -201,8 +489,7 @@ declare module "net" {
|
|
|
201
489
|
prependOnceListener(event: "ready", listener: () => void): this;
|
|
202
490
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
203
491
|
}
|
|
204
|
-
|
|
205
|
-
interface ListenOptions {
|
|
492
|
+
interface ListenOptions extends Abortable {
|
|
206
493
|
port?: number | undefined;
|
|
207
494
|
host?: string | undefined;
|
|
208
495
|
backlog?: number | undefined;
|
|
@@ -215,26 +502,93 @@ declare module "net" {
|
|
|
215
502
|
*/
|
|
216
503
|
ipv6Only?: boolean | undefined;
|
|
217
504
|
}
|
|
218
|
-
|
|
219
505
|
interface ServerOpts {
|
|
220
506
|
/**
|
|
221
507
|
* Indicates whether half-opened TCP connections are allowed.
|
|
222
508
|
* @default false
|
|
223
509
|
*/
|
|
224
510
|
allowHalfOpen?: boolean | undefined;
|
|
225
|
-
|
|
226
511
|
/**
|
|
227
512
|
* Indicates whether the socket should be paused on incoming connections.
|
|
228
513
|
* @default false
|
|
229
514
|
*/
|
|
230
515
|
pauseOnConnect?: boolean | undefined;
|
|
516
|
+
/**
|
|
517
|
+
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
|
|
518
|
+
* @default false
|
|
519
|
+
* @since v16.5.0
|
|
520
|
+
*/
|
|
521
|
+
noDelay?: boolean | undefined;
|
|
522
|
+
/**
|
|
523
|
+
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
524
|
+
* similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
|
|
525
|
+
* @default false
|
|
526
|
+
* @since v16.5.0
|
|
527
|
+
*/
|
|
528
|
+
keepAlive?: boolean | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
|
|
531
|
+
* @default 0
|
|
532
|
+
* @since v16.5.0
|
|
533
|
+
*/
|
|
534
|
+
keepAliveInitialDelay?: number | undefined;
|
|
535
|
+
}
|
|
536
|
+
interface DropArgument {
|
|
537
|
+
localAddress?: string;
|
|
538
|
+
localPort?: number;
|
|
539
|
+
localFamily?: string;
|
|
540
|
+
remoteAddress?: string;
|
|
541
|
+
remotePort?: number;
|
|
542
|
+
remoteFamily?: string;
|
|
231
543
|
}
|
|
232
|
-
|
|
233
|
-
|
|
544
|
+
/**
|
|
545
|
+
* This class is used to create a TCP or `IPC` server.
|
|
546
|
+
* @since v0.1.90
|
|
547
|
+
*/
|
|
234
548
|
class Server extends EventEmitter {
|
|
235
549
|
constructor(connectionListener?: (socket: Socket) => void);
|
|
236
550
|
constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
|
|
237
|
-
|
|
551
|
+
/**
|
|
552
|
+
* Start a server listening for connections. A `net.Server` can be a TCP or
|
|
553
|
+
* an `IPC` server depending on what it listens to.
|
|
554
|
+
*
|
|
555
|
+
* Possible signatures:
|
|
556
|
+
*
|
|
557
|
+
* * `server.listen(handle[, backlog][, callback])`
|
|
558
|
+
* * `server.listen(options[, callback])`
|
|
559
|
+
* * `server.listen(path[, backlog][, callback])` for `IPC` servers
|
|
560
|
+
* * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers
|
|
561
|
+
*
|
|
562
|
+
* This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'`
|
|
563
|
+
* event.
|
|
564
|
+
*
|
|
565
|
+
* All `listen()` methods can take a `backlog` parameter to specify the maximum
|
|
566
|
+
* length of the queue of pending connections. The actual length will be determined
|
|
567
|
+
* by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this parameter is 511 (not 512).
|
|
568
|
+
*
|
|
569
|
+
* All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for
|
|
570
|
+
* details).
|
|
571
|
+
*
|
|
572
|
+
* The `server.listen()` method can be called again if and only if there was an
|
|
573
|
+
* error during the first `server.listen()` call or `server.close()` has been
|
|
574
|
+
* called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown.
|
|
575
|
+
*
|
|
576
|
+
* One of the most common errors raised when listening is `EADDRINUSE`.
|
|
577
|
+
* This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry
|
|
578
|
+
* after a certain amount of time:
|
|
579
|
+
*
|
|
580
|
+
* ```js
|
|
581
|
+
* server.on('error', (e) => {
|
|
582
|
+
* if (e.code === 'EADDRINUSE') {
|
|
583
|
+
* console.error('Address in use, retrying...');
|
|
584
|
+
* setTimeout(() => {
|
|
585
|
+
* server.close();
|
|
586
|
+
* server.listen(PORT, HOST);
|
|
587
|
+
* }, 1000);
|
|
588
|
+
* }
|
|
589
|
+
* });
|
|
590
|
+
* ```
|
|
591
|
+
*/
|
|
238
592
|
listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
|
|
239
593
|
listen(port?: number, hostname?: string, listeningListener?: () => void): this;
|
|
240
594
|
listen(port?: number, backlog?: number, listeningListener?: () => void): this;
|
|
@@ -244,80 +598,401 @@ declare module "net" {
|
|
|
244
598
|
listen(options: ListenOptions, listeningListener?: () => void): this;
|
|
245
599
|
listen(handle: any, backlog?: number, listeningListener?: () => void): this;
|
|
246
600
|
listen(handle: any, listeningListener?: () => void): this;
|
|
601
|
+
/**
|
|
602
|
+
* Stops the server from accepting new connections and keeps existing
|
|
603
|
+
* connections. This function is asynchronous, the server is finally closed
|
|
604
|
+
* when all connections are ended and the server emits a `'close'` event.
|
|
605
|
+
* The optional `callback` will be called once the `'close'` event occurs. Unlike
|
|
606
|
+
* that event, it will be called with an `Error` as its only argument if the server
|
|
607
|
+
* was not open when it was closed.
|
|
608
|
+
* @since v0.1.90
|
|
609
|
+
* @param callback Called when the server is closed.
|
|
610
|
+
*/
|
|
247
611
|
close(callback?: (err?: Error) => void): this;
|
|
612
|
+
/**
|
|
613
|
+
* Returns the bound `address`, the address `family` name, and `port` of the server
|
|
614
|
+
* as reported by the operating system if listening on an IP socket
|
|
615
|
+
* (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
|
|
616
|
+
*
|
|
617
|
+
* For a server listening on a pipe or Unix domain socket, the name is returned
|
|
618
|
+
* as a string.
|
|
619
|
+
*
|
|
620
|
+
* ```js
|
|
621
|
+
* const server = net.createServer((socket) => {
|
|
622
|
+
* socket.end('goodbye\n');
|
|
623
|
+
* }).on('error', (err) => {
|
|
624
|
+
* // Handle errors here.
|
|
625
|
+
* throw err;
|
|
626
|
+
* });
|
|
627
|
+
*
|
|
628
|
+
* // Grab an arbitrary unused port.
|
|
629
|
+
* server.listen(() => {
|
|
630
|
+
* console.log('opened server on', server.address());
|
|
631
|
+
* });
|
|
632
|
+
* ```
|
|
633
|
+
*
|
|
634
|
+
* `server.address()` returns `null` before the `'listening'` event has been
|
|
635
|
+
* emitted or after calling `server.close()`.
|
|
636
|
+
* @since v0.1.90
|
|
637
|
+
*/
|
|
248
638
|
address(): AddressInfo | string | null;
|
|
639
|
+
/**
|
|
640
|
+
* Asynchronously get the number of concurrent connections on the server. Works
|
|
641
|
+
* when sockets were sent to forks.
|
|
642
|
+
*
|
|
643
|
+
* Callback should take two arguments `err` and `count`.
|
|
644
|
+
* @since v0.9.7
|
|
645
|
+
*/
|
|
249
646
|
getConnections(cb: (error: Error | null, count: number) => void): void;
|
|
647
|
+
/**
|
|
648
|
+
* Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior).
|
|
649
|
+
* If the server is `ref`ed calling `ref()` again will have no effect.
|
|
650
|
+
* @since v0.9.1
|
|
651
|
+
*/
|
|
250
652
|
ref(): this;
|
|
653
|
+
/**
|
|
654
|
+
* Calling `unref()` on a server will allow the program to exit if this is the only
|
|
655
|
+
* active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect.
|
|
656
|
+
* @since v0.9.1
|
|
657
|
+
*/
|
|
251
658
|
unref(): this;
|
|
659
|
+
/**
|
|
660
|
+
* Set this property to reject connections when the server's connection count gets
|
|
661
|
+
* high.
|
|
662
|
+
*
|
|
663
|
+
* It is not recommended to use this option once a socket has been sent to a child
|
|
664
|
+
* with `child_process.fork()`.
|
|
665
|
+
* @since v0.2.0
|
|
666
|
+
*/
|
|
252
667
|
maxConnections: number;
|
|
253
668
|
connections: number;
|
|
254
|
-
|
|
255
|
-
|
|
669
|
+
/**
|
|
670
|
+
* Indicates whether or not the server is listening for connections.
|
|
671
|
+
* @since v5.7.0
|
|
672
|
+
*/
|
|
673
|
+
readonly listening: boolean;
|
|
256
674
|
/**
|
|
257
675
|
* events.EventEmitter
|
|
258
676
|
* 1. close
|
|
259
677
|
* 2. connection
|
|
260
678
|
* 3. error
|
|
261
679
|
* 4. listening
|
|
680
|
+
* 5. drop
|
|
262
681
|
*/
|
|
263
682
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
264
683
|
addListener(event: "close", listener: () => void): this;
|
|
265
684
|
addListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
266
685
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
267
686
|
addListener(event: "listening", listener: () => void): this;
|
|
268
|
-
|
|
687
|
+
addListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
269
688
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
270
689
|
emit(event: "close"): boolean;
|
|
271
690
|
emit(event: "connection", socket: Socket): boolean;
|
|
272
691
|
emit(event: "error", err: Error): boolean;
|
|
273
692
|
emit(event: "listening"): boolean;
|
|
274
|
-
|
|
693
|
+
emit(event: "drop", data?: DropArgument): boolean;
|
|
275
694
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
276
695
|
on(event: "close", listener: () => void): this;
|
|
277
696
|
on(event: "connection", listener: (socket: Socket) => void): this;
|
|
278
697
|
on(event: "error", listener: (err: Error) => void): this;
|
|
279
698
|
on(event: "listening", listener: () => void): this;
|
|
280
|
-
|
|
699
|
+
on(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
281
700
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
282
701
|
once(event: "close", listener: () => void): this;
|
|
283
702
|
once(event: "connection", listener: (socket: Socket) => void): this;
|
|
284
703
|
once(event: "error", listener: (err: Error) => void): this;
|
|
285
704
|
once(event: "listening", listener: () => void): this;
|
|
286
|
-
|
|
705
|
+
once(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
287
706
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
288
707
|
prependListener(event: "close", listener: () => void): this;
|
|
289
708
|
prependListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
290
709
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
291
710
|
prependListener(event: "listening", listener: () => void): this;
|
|
292
|
-
|
|
711
|
+
prependListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
293
712
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
294
713
|
prependOnceListener(event: "close", listener: () => void): this;
|
|
295
714
|
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
|
|
296
715
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
297
716
|
prependOnceListener(event: "listening", listener: () => void): this;
|
|
717
|
+
prependOnceListener(event: "drop", listener: (data?: DropArgument) => void): this;
|
|
718
|
+
/**
|
|
719
|
+
* Calls {@link Server.close()} and returns a promise that fulfills when the server has closed.
|
|
720
|
+
* @since v20.5.0
|
|
721
|
+
*/
|
|
722
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
723
|
+
}
|
|
724
|
+
type IPVersion = "ipv4" | "ipv6";
|
|
725
|
+
/**
|
|
726
|
+
* The `BlockList` object can be used with some network APIs to specify rules for
|
|
727
|
+
* disabling inbound or outbound access to specific IP addresses, IP ranges, or
|
|
728
|
+
* IP subnets.
|
|
729
|
+
* @since v15.0.0, v14.18.0
|
|
730
|
+
*/
|
|
731
|
+
class BlockList {
|
|
732
|
+
/**
|
|
733
|
+
* Adds a rule to block the given IP address.
|
|
734
|
+
* @since v15.0.0, v14.18.0
|
|
735
|
+
* @param address An IPv4 or IPv6 address.
|
|
736
|
+
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
737
|
+
*/
|
|
738
|
+
addAddress(address: string, type?: IPVersion): void;
|
|
739
|
+
addAddress(address: SocketAddress): void;
|
|
740
|
+
/**
|
|
741
|
+
* Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive).
|
|
742
|
+
* @since v15.0.0, v14.18.0
|
|
743
|
+
* @param start The starting IPv4 or IPv6 address in the range.
|
|
744
|
+
* @param end The ending IPv4 or IPv6 address in the range.
|
|
745
|
+
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
746
|
+
*/
|
|
747
|
+
addRange(start: string, end: string, type?: IPVersion): void;
|
|
748
|
+
addRange(start: SocketAddress, end: SocketAddress): void;
|
|
749
|
+
/**
|
|
750
|
+
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
|
751
|
+
* @since v15.0.0, v14.18.0
|
|
752
|
+
* @param net The network IPv4 or IPv6 address.
|
|
753
|
+
* @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.
|
|
754
|
+
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
755
|
+
*/
|
|
756
|
+
addSubnet(net: SocketAddress, prefix: number): void;
|
|
757
|
+
addSubnet(net: string, prefix: number, type?: IPVersion): void;
|
|
758
|
+
/**
|
|
759
|
+
* Returns `true` if the given IP address matches any of the rules added to the`BlockList`.
|
|
760
|
+
*
|
|
761
|
+
* ```js
|
|
762
|
+
* const blockList = new net.BlockList();
|
|
763
|
+
* blockList.addAddress('123.123.123.123');
|
|
764
|
+
* blockList.addRange('10.0.0.1', '10.0.0.10');
|
|
765
|
+
* blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6');
|
|
766
|
+
*
|
|
767
|
+
* console.log(blockList.check('123.123.123.123')); // Prints: true
|
|
768
|
+
* console.log(blockList.check('10.0.0.3')); // Prints: true
|
|
769
|
+
* console.log(blockList.check('222.111.111.222')); // Prints: false
|
|
770
|
+
*
|
|
771
|
+
* // IPv6 notation for IPv4 addresses works:
|
|
772
|
+
* console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true
|
|
773
|
+
* console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true
|
|
774
|
+
* ```
|
|
775
|
+
* @since v15.0.0, v14.18.0
|
|
776
|
+
* @param address The IP address to check
|
|
777
|
+
* @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`.
|
|
778
|
+
*/
|
|
779
|
+
check(address: SocketAddress): boolean;
|
|
780
|
+
check(address: string, type?: IPVersion): boolean;
|
|
781
|
+
/**
|
|
782
|
+
* The list of rules added to the blocklist.
|
|
783
|
+
* @since v15.0.0, v14.18.0
|
|
784
|
+
*/
|
|
785
|
+
rules: readonly string[];
|
|
298
786
|
}
|
|
299
|
-
|
|
300
787
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
|
301
788
|
timeout?: number | undefined;
|
|
302
789
|
}
|
|
303
|
-
|
|
304
790
|
interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
|
|
305
791
|
timeout?: number | undefined;
|
|
306
792
|
}
|
|
307
|
-
|
|
308
793
|
type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
|
309
|
-
|
|
794
|
+
/**
|
|
795
|
+
* Creates a new TCP or `IPC` server.
|
|
796
|
+
*
|
|
797
|
+
* If `allowHalfOpen` is set to `true`, when the other end of the socket
|
|
798
|
+
* signals the end of transmission, the server will only send back the end of
|
|
799
|
+
* transmission when `socket.end()` is explicitly called. For example, in the
|
|
800
|
+
* context of TCP, when a FIN packed is received, a FIN packed is sent
|
|
801
|
+
* back only when `socket.end()` is explicitly called. Until then the
|
|
802
|
+
* connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information.
|
|
803
|
+
*
|
|
804
|
+
* If `pauseOnConnect` is set to `true`, then the socket associated with each
|
|
805
|
+
* incoming connection will be paused, and no data will be read from its handle.
|
|
806
|
+
* This allows connections to be passed between processes without any data being
|
|
807
|
+
* read by the original process. To begin reading data from a paused socket, call `socket.resume()`.
|
|
808
|
+
*
|
|
809
|
+
* The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
|
|
810
|
+
*
|
|
811
|
+
* Here is an example of a TCP echo server which listens for connections
|
|
812
|
+
* on port 8124:
|
|
813
|
+
*
|
|
814
|
+
* ```js
|
|
815
|
+
* const net = require('node:net');
|
|
816
|
+
* const server = net.createServer((c) => {
|
|
817
|
+
* // 'connection' listener.
|
|
818
|
+
* console.log('client connected');
|
|
819
|
+
* c.on('end', () => {
|
|
820
|
+
* console.log('client disconnected');
|
|
821
|
+
* });
|
|
822
|
+
* c.write('hello\r\n');
|
|
823
|
+
* c.pipe(c);
|
|
824
|
+
* });
|
|
825
|
+
* server.on('error', (err) => {
|
|
826
|
+
* throw err;
|
|
827
|
+
* });
|
|
828
|
+
* server.listen(8124, () => {
|
|
829
|
+
* console.log('server bound');
|
|
830
|
+
* });
|
|
831
|
+
* ```
|
|
832
|
+
*
|
|
833
|
+
* Test this by using `telnet`:
|
|
834
|
+
*
|
|
835
|
+
* ```bash
|
|
836
|
+
* telnet localhost 8124
|
|
837
|
+
* ```
|
|
838
|
+
*
|
|
839
|
+
* To listen on the socket `/tmp/echo.sock`:
|
|
840
|
+
*
|
|
841
|
+
* ```js
|
|
842
|
+
* server.listen('/tmp/echo.sock', () => {
|
|
843
|
+
* console.log('server bound');
|
|
844
|
+
* });
|
|
845
|
+
* ```
|
|
846
|
+
*
|
|
847
|
+
* Use `nc` to connect to a Unix domain socket server:
|
|
848
|
+
*
|
|
849
|
+
* ```bash
|
|
850
|
+
* nc -U /tmp/echo.sock
|
|
851
|
+
* ```
|
|
852
|
+
* @since v0.5.0
|
|
853
|
+
* @param connectionListener Automatically set as a listener for the {@link 'connection'} event.
|
|
854
|
+
*/
|
|
310
855
|
function createServer(connectionListener?: (socket: Socket) => void): Server;
|
|
311
856
|
function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
|
|
857
|
+
/**
|
|
858
|
+
* Aliases to {@link createConnection}.
|
|
859
|
+
*
|
|
860
|
+
* Possible signatures:
|
|
861
|
+
*
|
|
862
|
+
* * {@link connect}
|
|
863
|
+
* * {@link connect} for `IPC` connections.
|
|
864
|
+
* * {@link connect} for TCP connections.
|
|
865
|
+
*/
|
|
312
866
|
function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
|
|
313
867
|
function connect(port: number, host?: string, connectionListener?: () => void): Socket;
|
|
314
868
|
function connect(path: string, connectionListener?: () => void): Socket;
|
|
869
|
+
/**
|
|
870
|
+
* A factory function, which creates a new {@link Socket},
|
|
871
|
+
* immediately initiates connection with `socket.connect()`,
|
|
872
|
+
* then returns the `net.Socket` that starts the connection.
|
|
873
|
+
*
|
|
874
|
+
* When the connection is established, a `'connect'` event will be emitted
|
|
875
|
+
* on the returned socket. The last parameter `connectListener`, if supplied,
|
|
876
|
+
* will be added as a listener for the `'connect'` event **once**.
|
|
877
|
+
*
|
|
878
|
+
* Possible signatures:
|
|
879
|
+
*
|
|
880
|
+
* * {@link createConnection}
|
|
881
|
+
* * {@link createConnection} for `IPC` connections.
|
|
882
|
+
* * {@link createConnection} for TCP connections.
|
|
883
|
+
*
|
|
884
|
+
* The {@link connect} function is an alias to this function.
|
|
885
|
+
*/
|
|
315
886
|
function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket;
|
|
316
887
|
function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
|
|
317
888
|
function createConnection(path: string, connectionListener?: () => void): Socket;
|
|
889
|
+
/**
|
|
890
|
+
* Gets the current default value of the `autoSelectFamily` option of `socket.connect(options)`.
|
|
891
|
+
* The initial default value is `true`, unless the command line option`--no-network-family-autoselection` is provided.
|
|
892
|
+
* @since v19.4.0
|
|
893
|
+
*/
|
|
894
|
+
function getDefaultAutoSelectFamily(): boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Sets the default value of the `autoSelectFamily` option of `socket.connect(options)`.
|
|
897
|
+
* @since v19.4.0
|
|
898
|
+
*/
|
|
899
|
+
function setDefaultAutoSelectFamily(value: boolean): void;
|
|
900
|
+
/**
|
|
901
|
+
* Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
|
|
902
|
+
* The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`.
|
|
903
|
+
* @returns The current default value of the `autoSelectFamilyAttemptTimeout` option.
|
|
904
|
+
* @since v19.8.0, v18.8.0
|
|
905
|
+
*/
|
|
906
|
+
function getDefaultAutoSelectFamilyAttemptTimeout(): number;
|
|
907
|
+
/**
|
|
908
|
+
* Sets the default value of the `autoSelectFamilyAttemptTimeout` option of `socket.connect(options)`.
|
|
909
|
+
* @param value The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line
|
|
910
|
+
* option `--network-family-autoselection-attempt-timeout`.
|
|
911
|
+
* @since v19.8.0, v18.8.0
|
|
912
|
+
*/
|
|
913
|
+
function setDefaultAutoSelectFamilyAttemptTimeout(value: number): void;
|
|
914
|
+
/**
|
|
915
|
+
* Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4
|
|
916
|
+
* address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.
|
|
917
|
+
*
|
|
918
|
+
* ```js
|
|
919
|
+
* net.isIP('::1'); // returns 6
|
|
920
|
+
* net.isIP('127.0.0.1'); // returns 4
|
|
921
|
+
* net.isIP('127.000.000.001'); // returns 0
|
|
922
|
+
* net.isIP('127.0.0.1/24'); // returns 0
|
|
923
|
+
* net.isIP('fhqwhgads'); // returns 0
|
|
924
|
+
* ```
|
|
925
|
+
* @since v0.3.0
|
|
926
|
+
*/
|
|
318
927
|
function isIP(input: string): number;
|
|
928
|
+
/**
|
|
929
|
+
* Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no
|
|
930
|
+
* leading zeroes. Otherwise, returns `false`.
|
|
931
|
+
*
|
|
932
|
+
* ```js
|
|
933
|
+
* net.isIPv4('127.0.0.1'); // returns true
|
|
934
|
+
* net.isIPv4('127.000.000.001'); // returns false
|
|
935
|
+
* net.isIPv4('127.0.0.1/24'); // returns false
|
|
936
|
+
* net.isIPv4('fhqwhgads'); // returns false
|
|
937
|
+
* ```
|
|
938
|
+
* @since v0.3.0
|
|
939
|
+
*/
|
|
319
940
|
function isIPv4(input: string): boolean;
|
|
941
|
+
/**
|
|
942
|
+
* Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`.
|
|
943
|
+
*
|
|
944
|
+
* ```js
|
|
945
|
+
* net.isIPv6('::1'); // returns true
|
|
946
|
+
* net.isIPv6('fhqwhgads'); // returns false
|
|
947
|
+
* ```
|
|
948
|
+
* @since v0.3.0
|
|
949
|
+
*/
|
|
320
950
|
function isIPv6(input: string): boolean;
|
|
951
|
+
interface SocketAddressInitOptions {
|
|
952
|
+
/**
|
|
953
|
+
* The network address as either an IPv4 or IPv6 string.
|
|
954
|
+
* @default 127.0.0.1
|
|
955
|
+
*/
|
|
956
|
+
address?: string | undefined;
|
|
957
|
+
/**
|
|
958
|
+
* @default `'ipv4'`
|
|
959
|
+
*/
|
|
960
|
+
family?: IPVersion | undefined;
|
|
961
|
+
/**
|
|
962
|
+
* An IPv6 flow-label used only if `family` is `'ipv6'`.
|
|
963
|
+
* @default 0
|
|
964
|
+
*/
|
|
965
|
+
flowlabel?: number | undefined;
|
|
966
|
+
/**
|
|
967
|
+
* An IP port.
|
|
968
|
+
* @default 0
|
|
969
|
+
*/
|
|
970
|
+
port?: number | undefined;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* @since v15.14.0, v14.18.0
|
|
974
|
+
*/
|
|
975
|
+
class SocketAddress {
|
|
976
|
+
constructor(options: SocketAddressInitOptions);
|
|
977
|
+
/**
|
|
978
|
+
* Either \`'ipv4'\` or \`'ipv6'\`.
|
|
979
|
+
* @since v15.14.0, v14.18.0
|
|
980
|
+
*/
|
|
981
|
+
readonly address: string;
|
|
982
|
+
/**
|
|
983
|
+
* Either \`'ipv4'\` or \`'ipv6'\`.
|
|
984
|
+
* @since v15.14.0, v14.18.0
|
|
985
|
+
*/
|
|
986
|
+
readonly family: IPVersion;
|
|
987
|
+
/**
|
|
988
|
+
* @since v15.14.0, v14.18.0
|
|
989
|
+
*/
|
|
990
|
+
readonly port: number;
|
|
991
|
+
/**
|
|
992
|
+
* @since v15.14.0, v14.18.0
|
|
993
|
+
*/
|
|
994
|
+
readonly flowlabel: number;
|
|
995
|
+
}
|
|
321
996
|
}
|
|
322
997
|
declare module "node:net" {
|
|
323
998
|
export * from "net";
|