@pnpm/exe 11.0.0-dev.1005 → 11.0.0-rc.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/dist/node-gyp-bin/node-gyp +6 -0
- package/dist/node-gyp-bin/node-gyp.cmd +5 -0
- package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
- package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
- package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
- package/dist/node_modules/@gar/promise-retry/package.json +45 -0
- package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
- package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
- package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
- package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
- package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
- package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
- package/dist/node_modules/@npmcli/agent/package.json +60 -0
- package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
- package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
- package/dist/node_modules/@npmcli/fs/package.json +54 -0
- package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
- package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
- package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
- package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
- package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
- package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
- package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
- package/dist/node_modules/@npmcli/redact/package.json +52 -0
- package/dist/node_modules/abbrev/LICENSE +46 -0
- package/dist/node_modules/abbrev/lib/index.js +53 -0
- package/dist/node_modules/abbrev/package.json +41 -0
- package/dist/node_modules/agent-base/LICENSE +22 -0
- package/dist/node_modules/agent-base/dist/helpers.js +66 -0
- package/dist/node_modules/agent-base/dist/index.js +178 -0
- package/dist/node_modules/agent-base/package.json +46 -0
- package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/dist/node_modules/balanced-match/package.json +68 -0
- package/dist/node_modules/brace-expansion/LICENSE +23 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/dist/node_modules/brace-expansion/package.json +64 -0
- package/dist/node_modules/cacache/lib/content/path.js +29 -0
- package/dist/node_modules/cacache/lib/content/read.js +165 -0
- package/dist/node_modules/cacache/lib/content/rm.js +18 -0
- package/dist/node_modules/cacache/lib/content/write.js +206 -0
- package/dist/node_modules/cacache/lib/entry-index.js +336 -0
- package/dist/node_modules/cacache/lib/get.js +170 -0
- package/dist/node_modules/cacache/lib/index.js +42 -0
- package/dist/node_modules/cacache/lib/memoization.js +72 -0
- package/dist/node_modules/cacache/lib/put.js +80 -0
- package/dist/node_modules/cacache/lib/rm.js +31 -0
- package/dist/node_modules/cacache/lib/util/glob.js +7 -0
- package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
- package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
- package/dist/node_modules/cacache/lib/verify.js +258 -0
- package/dist/node_modules/cacache/package.json +81 -0
- package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/dist/node_modules/chownr/dist/esm/index.js +85 -0
- package/dist/node_modules/chownr/dist/esm/package.json +3 -0
- package/dist/node_modules/chownr/package.json +69 -0
- package/dist/node_modules/debug/LICENSE +20 -0
- package/dist/node_modules/debug/package.json +64 -0
- package/dist/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/env-paths/index.js +74 -0
- package/dist/node_modules/env-paths/license +9 -0
- package/dist/node_modules/env-paths/package.json +45 -0
- package/dist/node_modules/exponential-backoff/LICENSE +202 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
- package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
- package/dist/node_modules/exponential-backoff/package.json +62 -0
- package/dist/node_modules/fdir/LICENSE +7 -0
- package/dist/node_modules/fdir/dist/index.cjs +588 -0
- package/dist/node_modules/fdir/dist/index.d.cts +155 -0
- package/dist/node_modules/fdir/dist/index.d.mts +155 -0
- package/dist/node_modules/fdir/dist/index.mjs +570 -0
- package/dist/node_modules/fdir/package.json +103 -0
- package/dist/node_modules/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/fs-minipass/lib/index.js +443 -0
- package/dist/node_modules/fs-minipass/package.json +54 -0
- package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
- package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
- package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
- package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
- package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/dist/node_modules/glob/dist/esm/glob.js +244 -0
- package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
- package/dist/node_modules/glob/dist/esm/index.js +55 -0
- package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
- package/dist/node_modules/glob/dist/esm/processor.js +294 -0
- package/dist/node_modules/glob/dist/esm/walker.js +381 -0
- package/dist/node_modules/glob/package.json +98 -0
- package/dist/node_modules/graceful-fs/LICENSE +15 -0
- package/dist/node_modules/graceful-fs/clone.js +23 -0
- package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/dist/node_modules/graceful-fs/package.json +53 -0
- package/dist/node_modules/graceful-fs/polyfills.js +355 -0
- package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
- package/dist/node_modules/http-cache-semantics/index.js +928 -0
- package/dist/node_modules/http-cache-semantics/package.json +22 -0
- package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
- package/dist/node_modules/http-proxy-agent/package.json +47 -0
- package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
- package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
- package/dist/node_modules/https-proxy-agent/package.json +50 -0
- package/dist/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/iconv-lite/lib/index.js +182 -0
- package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
- package/dist/node_modules/iconv-lite/package.json +70 -0
- package/dist/node_modules/ip-address/LICENSE +19 -0
- package/dist/node_modules/ip-address/dist/address-error.js +12 -0
- package/dist/node_modules/ip-address/dist/common.js +46 -0
- package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
- package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
- package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
- package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
- package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
- package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/dist/node_modules/ip-address/package.json +78 -0
- package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/dist/node_modules/isexe/dist/esm/index.js +16 -0
- package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/esm/options.js +2 -0
- package/dist/node_modules/isexe/dist/esm/package.json +3 -0
- package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
- package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
- package/dist/node_modules/isexe/package.json +78 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/dist/node_modules/lru-cache/dist/esm/index.js +1591 -0
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/dist/node_modules/lru-cache/package.json +93 -0
- package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
- package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
- package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
- package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
- package/dist/node_modules/make-fetch-happen/package.json +75 -0
- package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +846 -0
- package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/dist/node_modules/minimatch/dist/commonjs/index.js +1121 -0
- package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/dist/node_modules/minimatch/dist/esm/ast.js +842 -0
- package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/dist/node_modules/minimatch/dist/esm/index.js +1108 -0
- package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
- package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/dist/node_modules/minimatch/package.json +67 -0
- package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
- package/dist/node_modules/minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass/package.json +77 -0
- package/dist/node_modules/minipass-collect/LICENSE +15 -0
- package/dist/node_modules/minipass-collect/index.js +71 -0
- package/dist/node_modules/minipass-collect/package.json +30 -0
- package/dist/node_modules/minipass-fetch/LICENSE +28 -0
- package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
- package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
- package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
- package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
- package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
- package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
- package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
- package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
- package/dist/node_modules/minipass-fetch/package.json +70 -0
- package/dist/node_modules/minipass-flush/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/index.js +39 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-flush/package.json +39 -0
- package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/index.js +128 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-pipeline/package.json +29 -0
- package/dist/node_modules/minipass-sized/LICENSE +15 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
- package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass-sized/package.json +69 -0
- package/dist/node_modules/minizlib/LICENSE +26 -0
- package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
- package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
- package/dist/node_modules/minizlib/package.json +80 -0
- package/dist/node_modules/ms/index.js +162 -0
- package/dist/node_modules/ms/package.json +38 -0
- package/dist/node_modules/negotiator/LICENSE +24 -0
- package/dist/node_modules/negotiator/index.js +83 -0
- package/dist/node_modules/negotiator/lib/charset.js +169 -0
- package/dist/node_modules/negotiator/lib/encoding.js +205 -0
- package/dist/node_modules/negotiator/lib/language.js +179 -0
- package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
- package/dist/node_modules/negotiator/package.json +43 -0
- package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/LICENSE +24 -0
- package/dist/node_modules/node-gyp/addon.gypi +204 -0
- package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
- package/dist/node_modules/node-gyp/eslint.config.js +3 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
- package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
- package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
- package/dist/node_modules/node-gyp/gyp/gyp +8 -0
- package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
- package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
- package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
- package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
- package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
- package/dist/node_modules/node-gyp/lib/build.js +230 -0
- package/dist/node_modules/node-gyp/lib/clean.js +15 -0
- package/dist/node_modules/node-gyp/lib/configure.js +328 -0
- package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
- package/dist/node_modules/node-gyp/lib/download.js +39 -0
- package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
- package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
- package/dist/node_modules/node-gyp/lib/install.js +411 -0
- package/dist/node_modules/node-gyp/lib/list.js +26 -0
- package/dist/node_modules/node-gyp/lib/log.js +168 -0
- package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
- package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
- package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
- package/dist/node_modules/node-gyp/lib/remove.js +43 -0
- package/dist/node_modules/node-gyp/lib/util.js +81 -0
- package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
- package/dist/node_modules/node-gyp/package.json +52 -0
- package/dist/node_modules/node-gyp/release-please-config.json +40 -0
- package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
- package/dist/node_modules/nopt/LICENSE +15 -0
- package/dist/node_modules/nopt/bin/nopt.js +29 -0
- package/dist/node_modules/nopt/lib/debug.js +5 -0
- package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
- package/dist/node_modules/nopt/lib/nopt.js +34 -0
- package/dist/node_modules/nopt/lib/type-defs.js +91 -0
- package/dist/node_modules/nopt/package.json +52 -0
- package/dist/node_modules/p-map/index.js +283 -0
- package/dist/node_modules/p-map/license +9 -0
- package/dist/node_modules/p-map/package.json +57 -0
- package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/dist/node_modules/path-scurry/package.json +72 -0
- package/dist/node_modules/picomatch/LICENSE +21 -0
- package/dist/node_modules/picomatch/index.js +17 -0
- package/dist/node_modules/picomatch/lib/constants.js +184 -0
- package/dist/node_modules/picomatch/lib/parse.js +1386 -0
- package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
- package/dist/node_modules/picomatch/lib/scan.js +391 -0
- package/dist/node_modules/picomatch/lib/utils.js +72 -0
- package/dist/node_modules/picomatch/package.json +82 -0
- package/dist/node_modules/picomatch/posix.js +3 -0
- package/dist/node_modules/proc-log/LICENSE +15 -0
- package/dist/node_modules/proc-log/lib/index.js +158 -0
- package/dist/node_modules/proc-log/package.json +46 -0
- package/dist/node_modules/safer-buffer/LICENSE +21 -0
- package/dist/node_modules/safer-buffer/dangerous.js +58 -0
- package/dist/node_modules/safer-buffer/package.json +34 -0
- package/dist/node_modules/safer-buffer/safer.js +77 -0
- package/dist/node_modules/safer-buffer/tests.js +406 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/bin/semver.js +191 -0
- package/dist/node_modules/semver/classes/comparator.js +143 -0
- package/dist/node_modules/semver/classes/index.js +7 -0
- package/dist/node_modules/semver/classes/range.js +557 -0
- package/dist/node_modules/semver/classes/semver.js +333 -0
- package/dist/node_modules/semver/functions/clean.js +8 -0
- package/dist/node_modules/semver/functions/cmp.js +54 -0
- package/dist/node_modules/semver/functions/coerce.js +62 -0
- package/dist/node_modules/semver/functions/compare-build.js +9 -0
- package/dist/node_modules/semver/functions/compare-loose.js +5 -0
- package/dist/node_modules/semver/functions/compare.js +7 -0
- package/dist/node_modules/semver/functions/diff.js +60 -0
- package/dist/node_modules/semver/functions/eq.js +5 -0
- package/dist/node_modules/semver/functions/gt.js +5 -0
- package/dist/node_modules/semver/functions/gte.js +5 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +5 -0
- package/dist/node_modules/semver/functions/lte.js +5 -0
- package/dist/node_modules/semver/functions/major.js +5 -0
- package/dist/node_modules/semver/functions/minor.js +5 -0
- package/dist/node_modules/semver/functions/neq.js +5 -0
- package/dist/node_modules/semver/functions/parse.js +18 -0
- package/dist/node_modules/semver/functions/patch.js +5 -0
- package/dist/node_modules/semver/functions/prerelease.js +8 -0
- package/dist/node_modules/semver/functions/rcompare.js +5 -0
- package/dist/node_modules/semver/functions/rsort.js +5 -0
- package/dist/node_modules/semver/functions/satisfies.js +12 -0
- package/dist/node_modules/semver/functions/sort.js +5 -0
- package/dist/node_modules/semver/functions/valid.js +8 -0
- package/dist/node_modules/semver/index.js +91 -0
- package/dist/node_modules/semver/internal/constants.js +37 -0
- package/dist/node_modules/semver/internal/debug.js +11 -0
- package/dist/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/semver/internal/parse-options.js +17 -0
- package/dist/node_modules/semver/internal/re.js +223 -0
- package/dist/node_modules/semver/package.json +78 -0
- package/dist/node_modules/semver/preload.js +4 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +6 -0
- package/dist/node_modules/semver/ranges/intersects.js +9 -0
- package/dist/node_modules/semver/ranges/ltr.js +6 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/dist/node_modules/semver/ranges/min-version.js +63 -0
- package/dist/node_modules/semver/ranges/outside.js +82 -0
- package/dist/node_modules/semver/ranges/simplify.js +49 -0
- package/dist/node_modules/semver/ranges/subset.js +249 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
- package/dist/node_modules/semver/ranges/valid.js +13 -0
- package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/dist/node_modules/smart-buffer/LICENSE +20 -0
- package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/dist/node_modules/smart-buffer/build/utils.js +108 -0
- package/dist/node_modules/smart-buffer/package.json +79 -0
- package/dist/node_modules/socks/.eslintrc.cjs +11 -0
- package/dist/node_modules/socks/.prettierrc.yaml +7 -0
- package/dist/node_modules/socks/LICENSE +20 -0
- package/dist/node_modules/socks/build/client/socksclient.js +793 -0
- package/dist/node_modules/socks/build/common/constants.js +108 -0
- package/dist/node_modules/socks/build/common/helpers.js +167 -0
- package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/dist/node_modules/socks/build/common/util.js +25 -0
- package/dist/node_modules/socks/build/index.js +18 -0
- package/dist/node_modules/socks/package.json +58 -0
- package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
- package/dist/node_modules/socks-proxy-agent/package.json +142 -0
- package/dist/node_modules/ssri/lib/index.js +550 -0
- package/dist/node_modules/ssri/package.json +66 -0
- package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
- package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
- package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
- package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
- package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/dist/node_modules/tar/dist/esm/create.js +76 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/dist/node_modules/tar/dist/esm/extract.js +49 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/dist/node_modules/tar/dist/esm/header.js +275 -0
- package/dist/node_modules/tar/dist/esm/index.js +20 -0
- package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/dist/node_modules/tar/dist/esm/list.js +105 -0
- package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
- package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/dist/node_modules/tar/dist/esm/options.js +54 -0
- package/dist/node_modules/tar/dist/esm/pack.js +469 -0
- package/dist/node_modules/tar/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/dist/esm/parse.js +606 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/dist/node_modules/tar/dist/esm/pax.js +154 -0
- package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/dist/node_modules/tar/dist/esm/replace.js +221 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/dist/node_modules/tar/dist/esm/types.js +45 -0
- package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
- package/dist/node_modules/tar/dist/esm/update.js +30 -0
- package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
- package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
- package/dist/node_modules/tar/package.json +297 -0
- package/dist/node_modules/tinyglobby/LICENSE +21 -0
- package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
- package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
- package/dist/node_modules/tinyglobby/package.json +73 -0
- package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
- package/dist/node_modules/v8-compile-cache/package.json +34 -0
- package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
- package/dist/node_modules/which/LICENSE +15 -0
- package/dist/node_modules/which/bin/which.js +52 -0
- package/dist/node_modules/which/lib/index.js +111 -0
- package/dist/node_modules/which/package.json +52 -0
- package/dist/node_modules/yallist/LICENSE +15 -0
- package/dist/node_modules/yallist/iterator.js +8 -0
- package/dist/node_modules/yallist/package.json +29 -0
- package/dist/node_modules/yallist/yallist.js +426 -0
- package/dist/pnpm.mjs +266382 -0
- package/dist/pnpmrc +2 -0
- package/dist/templates/completion.bash +31 -0
- package/dist/templates/completion.fish +22 -0
- package/dist/templates/completion.ps1 +193 -0
- package/dist/templates/completion.zsh +27 -0
- package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
- package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
- package/dist/worker.js +10958 -0
- package/package.json +34 -11
- package/pn +2 -0
- package/pn.cmd +2 -0
- package/pn.ps1 +1 -0
- package/pnpx +2 -0
- package/pnpx.cmd +2 -0
- package/pnpx.ps1 +1 -0
- package/pnx +2 -0
- package/pnx.cmd +2 -0
- package/pnx.ps1 +1 -0
- package/prepare.js +26 -3
- package/setup.js +22 -11
- package/CHANGELOG.md +0 -15
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { LRUCache } = require('lru-cache')
|
|
4
|
+
const dns = require('dns')
|
|
5
|
+
|
|
6
|
+
// this is a factory so that each request can have its own opts (i.e. ttl)
|
|
7
|
+
// while still sharing the cache across all requests
|
|
8
|
+
const cache = new LRUCache({ max: 50 })
|
|
9
|
+
|
|
10
|
+
const getOptions = ({
|
|
11
|
+
family = 0,
|
|
12
|
+
hints = dns.ADDRCONFIG,
|
|
13
|
+
all = false,
|
|
14
|
+
verbatim = undefined,
|
|
15
|
+
ttl = 5 * 60 * 1000,
|
|
16
|
+
lookup = dns.lookup,
|
|
17
|
+
}) => ({
|
|
18
|
+
// hints and lookup are returned since both are top level properties to (net|tls).connect
|
|
19
|
+
hints,
|
|
20
|
+
lookup: (hostname, ...args) => {
|
|
21
|
+
const callback = args.pop() // callback is always last arg
|
|
22
|
+
const lookupOptions = args[0] ?? {}
|
|
23
|
+
|
|
24
|
+
const options = {
|
|
25
|
+
family,
|
|
26
|
+
hints,
|
|
27
|
+
all,
|
|
28
|
+
verbatim,
|
|
29
|
+
...(typeof lookupOptions === 'number' ? { family: lookupOptions } : lookupOptions),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const key = JSON.stringify({ hostname, ...options })
|
|
33
|
+
|
|
34
|
+
if (cache.has(key)) {
|
|
35
|
+
const cached = cache.get(key)
|
|
36
|
+
return process.nextTick(callback, null, ...cached)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
lookup(hostname, options, (err, ...result) => {
|
|
40
|
+
if (err) {
|
|
41
|
+
return callback(err)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
cache.set(key, result, { ttl })
|
|
45
|
+
return callback(null, ...result)
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
module.exports = {
|
|
51
|
+
cache,
|
|
52
|
+
getOptions,
|
|
53
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
class InvalidProxyProtocolError extends Error {
|
|
4
|
+
constructor (url) {
|
|
5
|
+
super(`Invalid protocol \`${url.protocol}\` connecting to proxy \`${url.host}\``)
|
|
6
|
+
this.code = 'EINVALIDPROXY'
|
|
7
|
+
this.proxy = url
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class ConnectionTimeoutError extends Error {
|
|
12
|
+
constructor (host) {
|
|
13
|
+
super(`Timeout connecting to host \`${host}\``)
|
|
14
|
+
this.code = 'ECONNECTIONTIMEOUT'
|
|
15
|
+
this.host = host
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class IdleTimeoutError extends Error {
|
|
20
|
+
constructor (host) {
|
|
21
|
+
super(`Idle timeout reached for host \`${host}\``)
|
|
22
|
+
this.code = 'EIDLETIMEOUT'
|
|
23
|
+
this.host = host
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class ResponseTimeoutError extends Error {
|
|
28
|
+
constructor (request, proxy) {
|
|
29
|
+
let msg = 'Response timeout '
|
|
30
|
+
if (proxy) {
|
|
31
|
+
msg += `from proxy \`${proxy.host}\` `
|
|
32
|
+
}
|
|
33
|
+
msg += `connecting to host \`${request.host}\``
|
|
34
|
+
super(msg)
|
|
35
|
+
this.code = 'ERESPONSETIMEOUT'
|
|
36
|
+
this.proxy = proxy
|
|
37
|
+
this.request = request
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
class TransferTimeoutError extends Error {
|
|
42
|
+
constructor (request, proxy) {
|
|
43
|
+
let msg = 'Transfer timeout '
|
|
44
|
+
if (proxy) {
|
|
45
|
+
msg += `from proxy \`${proxy.host}\` `
|
|
46
|
+
}
|
|
47
|
+
msg += `for \`${request.host}\``
|
|
48
|
+
super(msg)
|
|
49
|
+
this.code = 'ETRANSFERTIMEOUT'
|
|
50
|
+
this.proxy = proxy
|
|
51
|
+
this.request = request
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = {
|
|
56
|
+
InvalidProxyProtocolError,
|
|
57
|
+
ConnectionTimeoutError,
|
|
58
|
+
IdleTimeoutError,
|
|
59
|
+
ResponseTimeoutError,
|
|
60
|
+
TransferTimeoutError,
|
|
61
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { LRUCache } = require('lru-cache')
|
|
4
|
+
const { normalizeOptions, cacheOptions } = require('./options')
|
|
5
|
+
const { getProxy, proxyCache } = require('./proxy.js')
|
|
6
|
+
const dns = require('./dns.js')
|
|
7
|
+
const Agent = require('./agents.js')
|
|
8
|
+
|
|
9
|
+
const agentCache = new LRUCache({ max: 20 })
|
|
10
|
+
|
|
11
|
+
const getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => {
|
|
12
|
+
// false has meaning so this can't be a simple truthiness check
|
|
13
|
+
if (agent != null) {
|
|
14
|
+
return agent
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
url = new URL(url)
|
|
18
|
+
|
|
19
|
+
const proxyForUrl = getProxy(url, { proxy, noProxy })
|
|
20
|
+
const normalizedOptions = {
|
|
21
|
+
...normalizeOptions(options),
|
|
22
|
+
proxy: proxyForUrl,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const cacheKey = cacheOptions({
|
|
26
|
+
...normalizedOptions,
|
|
27
|
+
secureEndpoint: url.protocol === 'https:',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
if (agentCache.has(cacheKey)) {
|
|
31
|
+
return agentCache.get(cacheKey)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const newAgent = new Agent(normalizedOptions)
|
|
35
|
+
agentCache.set(cacheKey, newAgent)
|
|
36
|
+
|
|
37
|
+
return newAgent
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = {
|
|
41
|
+
getAgent,
|
|
42
|
+
Agent,
|
|
43
|
+
// these are exported for backwards compatability
|
|
44
|
+
HttpAgent: Agent,
|
|
45
|
+
HttpsAgent: Agent,
|
|
46
|
+
cache: {
|
|
47
|
+
proxy: proxyCache,
|
|
48
|
+
agent: agentCache,
|
|
49
|
+
dns: dns.cache,
|
|
50
|
+
clear: () => {
|
|
51
|
+
proxyCache.clear()
|
|
52
|
+
agentCache.clear()
|
|
53
|
+
dns.cache.clear()
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const dns = require('./dns')
|
|
4
|
+
|
|
5
|
+
const normalizeOptions = (opts) => {
|
|
6
|
+
const family = parseInt(opts.family ?? '0', 10)
|
|
7
|
+
const keepAlive = opts.keepAlive ?? true
|
|
8
|
+
|
|
9
|
+
const normalized = {
|
|
10
|
+
// nodejs http agent options. these are all the defaults
|
|
11
|
+
// but kept here to increase the likelihood of cache hits
|
|
12
|
+
// https://nodejs.org/api/http.html#new-agentoptions
|
|
13
|
+
keepAliveMsecs: keepAlive ? 1000 : undefined,
|
|
14
|
+
maxSockets: opts.maxSockets ?? 15,
|
|
15
|
+
maxTotalSockets: Infinity,
|
|
16
|
+
maxFreeSockets: keepAlive ? 256 : undefined,
|
|
17
|
+
scheduling: 'fifo',
|
|
18
|
+
// then spread the rest of the options
|
|
19
|
+
...opts,
|
|
20
|
+
// we already set these to their defaults that we want
|
|
21
|
+
family,
|
|
22
|
+
keepAlive,
|
|
23
|
+
// our custom timeout options
|
|
24
|
+
timeouts: {
|
|
25
|
+
// the standard timeout option is mapped to our idle timeout
|
|
26
|
+
// and then deleted below
|
|
27
|
+
idle: opts.timeout ?? 0,
|
|
28
|
+
connection: 0,
|
|
29
|
+
response: 0,
|
|
30
|
+
transfer: 0,
|
|
31
|
+
...opts.timeouts,
|
|
32
|
+
},
|
|
33
|
+
// get the dns options that go at the top level of socket connection
|
|
34
|
+
...dns.getOptions({ family, ...opts.dns }),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// remove timeout since we already used it to set our own idle timeout
|
|
38
|
+
delete normalized.timeout
|
|
39
|
+
|
|
40
|
+
return normalized
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const createKey = (obj) => {
|
|
44
|
+
let key = ''
|
|
45
|
+
const sorted = Object.entries(obj).sort((a, b) => a[0] - b[0])
|
|
46
|
+
for (let [k, v] of sorted) {
|
|
47
|
+
if (v == null) {
|
|
48
|
+
v = 'null'
|
|
49
|
+
} else if (v instanceof URL) {
|
|
50
|
+
v = v.toString()
|
|
51
|
+
} else if (typeof v === 'object') {
|
|
52
|
+
v = createKey(v)
|
|
53
|
+
}
|
|
54
|
+
key += `${k}:${v}:`
|
|
55
|
+
}
|
|
56
|
+
return key
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const cacheOptions = ({ secureEndpoint, ...options }) => createKey({
|
|
60
|
+
secureEndpoint: !!secureEndpoint,
|
|
61
|
+
// socket connect options
|
|
62
|
+
family: options.family,
|
|
63
|
+
hints: options.hints,
|
|
64
|
+
localAddress: options.localAddress,
|
|
65
|
+
// tls specific connect options
|
|
66
|
+
strictSsl: secureEndpoint ? !!options.rejectUnauthorized : false,
|
|
67
|
+
ca: secureEndpoint ? options.ca : null,
|
|
68
|
+
cert: secureEndpoint ? options.cert : null,
|
|
69
|
+
key: secureEndpoint ? options.key : null,
|
|
70
|
+
// http agent options
|
|
71
|
+
keepAlive: options.keepAlive,
|
|
72
|
+
keepAliveMsecs: options.keepAliveMsecs,
|
|
73
|
+
maxSockets: options.maxSockets,
|
|
74
|
+
maxTotalSockets: options.maxTotalSockets,
|
|
75
|
+
maxFreeSockets: options.maxFreeSockets,
|
|
76
|
+
scheduling: options.scheduling,
|
|
77
|
+
// timeout options
|
|
78
|
+
timeouts: options.timeouts,
|
|
79
|
+
// proxy
|
|
80
|
+
proxy: options.proxy,
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
module.exports = {
|
|
84
|
+
normalizeOptions,
|
|
85
|
+
cacheOptions,
|
|
86
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { HttpProxyAgent } = require('http-proxy-agent')
|
|
4
|
+
const { HttpsProxyAgent } = require('https-proxy-agent')
|
|
5
|
+
const { SocksProxyAgent } = require('socks-proxy-agent')
|
|
6
|
+
const { LRUCache } = require('lru-cache')
|
|
7
|
+
const { InvalidProxyProtocolError } = require('./errors.js')
|
|
8
|
+
|
|
9
|
+
const PROXY_CACHE = new LRUCache({ max: 20 })
|
|
10
|
+
|
|
11
|
+
const SOCKS_PROTOCOLS = new Set(SocksProxyAgent.protocols)
|
|
12
|
+
|
|
13
|
+
const PROXY_ENV_KEYS = new Set(['https_proxy', 'http_proxy', 'proxy', 'no_proxy'])
|
|
14
|
+
|
|
15
|
+
const PROXY_ENV = Object.entries(process.env).reduce((acc, [key, value]) => {
|
|
16
|
+
key = key.toLowerCase()
|
|
17
|
+
if (PROXY_ENV_KEYS.has(key)) {
|
|
18
|
+
acc[key] = value
|
|
19
|
+
}
|
|
20
|
+
return acc
|
|
21
|
+
}, {})
|
|
22
|
+
|
|
23
|
+
const getProxyAgent = (url) => {
|
|
24
|
+
url = new URL(url)
|
|
25
|
+
|
|
26
|
+
const protocol = url.protocol.slice(0, -1)
|
|
27
|
+
if (SOCKS_PROTOCOLS.has(protocol)) {
|
|
28
|
+
return SocksProxyAgent
|
|
29
|
+
}
|
|
30
|
+
if (protocol === 'https' || protocol === 'http') {
|
|
31
|
+
return [HttpProxyAgent, HttpsProxyAgent]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
throw new InvalidProxyProtocolError(url)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const isNoProxy = (url, noProxy) => {
|
|
38
|
+
if (typeof noProxy === 'string') {
|
|
39
|
+
noProxy = noProxy.split(',').map((p) => p.trim()).filter(Boolean)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!noProxy || !noProxy.length) {
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const hostSegments = url.hostname.split('.').reverse()
|
|
47
|
+
|
|
48
|
+
return noProxy.some((no) => {
|
|
49
|
+
const noSegments = no.split('.').filter(Boolean).reverse()
|
|
50
|
+
if (!noSegments.length) {
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for (let i = 0; i < noSegments.length; i++) {
|
|
55
|
+
if (hostSegments[i] !== noSegments[i]) {
|
|
56
|
+
return false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return true
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const getProxy = (url, { proxy, noProxy }) => {
|
|
65
|
+
url = new URL(url)
|
|
66
|
+
|
|
67
|
+
if (!proxy) {
|
|
68
|
+
proxy = url.protocol === 'https:'
|
|
69
|
+
? PROXY_ENV.https_proxy
|
|
70
|
+
: PROXY_ENV.https_proxy || PROXY_ENV.http_proxy || PROXY_ENV.proxy
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!noProxy) {
|
|
74
|
+
noProxy = PROXY_ENV.no_proxy
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!proxy || isNoProxy(url, noProxy)) {
|
|
78
|
+
return null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return new URL(proxy)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = {
|
|
85
|
+
getProxyAgent,
|
|
86
|
+
getProxy,
|
|
87
|
+
proxyCache: PROXY_CACHE,
|
|
88
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@npmcli/agent",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "the http/https agent used by the npm cli",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"gencerts": "bash scripts/create-cert.sh",
|
|
8
|
+
"test": "tap",
|
|
9
|
+
"lint": "npm run eslint",
|
|
10
|
+
"postlint": "template-oss-check",
|
|
11
|
+
"template-oss-apply": "template-oss-apply --force",
|
|
12
|
+
"lintfix": "npm run eslint -- --fix",
|
|
13
|
+
"snap": "tap",
|
|
14
|
+
"posttest": "npm run lint",
|
|
15
|
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
|
16
|
+
},
|
|
17
|
+
"author": "GitHub Inc.",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/npm/agent/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/npm/agent#readme",
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/",
|
|
25
|
+
"lib/"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": "^20.17.0 || >=22.9.0"
|
|
29
|
+
},
|
|
30
|
+
"templateOSS": {
|
|
31
|
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
32
|
+
"version": "4.25.0",
|
|
33
|
+
"publish": "true"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"agent-base": "^7.1.0",
|
|
37
|
+
"http-proxy-agent": "^7.0.0",
|
|
38
|
+
"https-proxy-agent": "^7.0.1",
|
|
39
|
+
"lru-cache": "^11.2.1",
|
|
40
|
+
"socks-proxy-agent": "^8.0.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@npmcli/eslint-config": "^5.0.0",
|
|
44
|
+
"@npmcli/template-oss": "4.25.0",
|
|
45
|
+
"minipass-fetch": "^4.0.1",
|
|
46
|
+
"nock": "^14.0.3",
|
|
47
|
+
"socksv5": "^0.0.6",
|
|
48
|
+
"tap": "^16.3.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/npm/agent.git"
|
|
53
|
+
},
|
|
54
|
+
"tap": {
|
|
55
|
+
"nyc-arg": [
|
|
56
|
+
"--exclude",
|
|
57
|
+
"tap-snapshots/**"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// given an input that may or may not be an object, return an object that has
|
|
2
|
+
// a copy of every defined property listed in 'copy'. if the input is not an
|
|
3
|
+
// object, assign it to the property named by 'wrap'
|
|
4
|
+
const getOptions = (input, { copy, wrap }) => {
|
|
5
|
+
const result = {}
|
|
6
|
+
|
|
7
|
+
if (input && typeof input === 'object') {
|
|
8
|
+
for (const prop of copy) {
|
|
9
|
+
if (input[prop] !== undefined) {
|
|
10
|
+
result[prop] = input[prop]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
result[wrap] = input
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return result
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = getOptions
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2011-2017 JP Richardson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
6
|
+
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
7
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
13
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
14
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
15
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const { inspect } = require('util')
|
|
3
|
+
|
|
4
|
+
// adapted from node's internal/errors
|
|
5
|
+
// https://github.com/nodejs/node/blob/c8a04049/lib/internal/errors.js
|
|
6
|
+
|
|
7
|
+
// close copy of node's internal SystemError class.
|
|
8
|
+
class SystemError {
|
|
9
|
+
constructor (code, prefix, context) {
|
|
10
|
+
// XXX context.code is undefined in all constructors used in cp/polyfill
|
|
11
|
+
// that may be a bug copied from node, maybe the constructor should use
|
|
12
|
+
// `code` not `errno`? nodejs/node#41104
|
|
13
|
+
let message = `${prefix}: ${context.syscall} returned ` +
|
|
14
|
+
`${context.code} (${context.message})`
|
|
15
|
+
|
|
16
|
+
if (context.path !== undefined) {
|
|
17
|
+
message += ` ${context.path}`
|
|
18
|
+
}
|
|
19
|
+
if (context.dest !== undefined) {
|
|
20
|
+
message += ` => ${context.dest}`
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
this.code = code
|
|
24
|
+
Object.defineProperties(this, {
|
|
25
|
+
name: {
|
|
26
|
+
value: 'SystemError',
|
|
27
|
+
enumerable: false,
|
|
28
|
+
writable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
},
|
|
31
|
+
message: {
|
|
32
|
+
value: message,
|
|
33
|
+
enumerable: false,
|
|
34
|
+
writable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
},
|
|
37
|
+
info: {
|
|
38
|
+
value: context,
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: false,
|
|
42
|
+
},
|
|
43
|
+
errno: {
|
|
44
|
+
get () {
|
|
45
|
+
return context.errno
|
|
46
|
+
},
|
|
47
|
+
set (value) {
|
|
48
|
+
context.errno = value
|
|
49
|
+
},
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
},
|
|
53
|
+
syscall: {
|
|
54
|
+
get () {
|
|
55
|
+
return context.syscall
|
|
56
|
+
},
|
|
57
|
+
set (value) {
|
|
58
|
+
context.syscall = value
|
|
59
|
+
},
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
if (context.path !== undefined) {
|
|
66
|
+
Object.defineProperty(this, 'path', {
|
|
67
|
+
get () {
|
|
68
|
+
return context.path
|
|
69
|
+
},
|
|
70
|
+
set (value) {
|
|
71
|
+
context.path = value
|
|
72
|
+
},
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (context.dest !== undefined) {
|
|
79
|
+
Object.defineProperty(this, 'dest', {
|
|
80
|
+
get () {
|
|
81
|
+
return context.dest
|
|
82
|
+
},
|
|
83
|
+
set (value) {
|
|
84
|
+
context.dest = value
|
|
85
|
+
},
|
|
86
|
+
enumerable: true,
|
|
87
|
+
configurable: true,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
toString () {
|
|
93
|
+
return `${this.name} [${this.code}]: ${this.message}`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[Symbol.for('nodejs.util.inspect.custom')] (_recurseTimes, ctx) {
|
|
97
|
+
return inspect(this, {
|
|
98
|
+
...ctx,
|
|
99
|
+
getters: true,
|
|
100
|
+
customInspect: false,
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function E (code, message) {
|
|
106
|
+
module.exports[code] = class NodeError extends SystemError {
|
|
107
|
+
constructor (ctx) {
|
|
108
|
+
super(code, message, ctx)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
E('ERR_FS_CP_DIR_TO_NON_DIR', 'Cannot overwrite directory with non-directory')
|
|
114
|
+
E('ERR_FS_CP_EEXIST', 'Target already exists')
|
|
115
|
+
E('ERR_FS_CP_EINVAL', 'Invalid src or dest')
|
|
116
|
+
E('ERR_FS_CP_FIFO_PIPE', 'Cannot copy a FIFO pipe')
|
|
117
|
+
E('ERR_FS_CP_NON_DIR_TO_DIR', 'Cannot overwrite non-directory with directory')
|
|
118
|
+
E('ERR_FS_CP_SOCKET', 'Cannot copy a socket file')
|
|
119
|
+
E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self')
|
|
120
|
+
E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type')
|
|
121
|
+
E('ERR_FS_EISDIR', 'Path is a directory')
|
|
122
|
+
|
|
123
|
+
module.exports.ERR_INVALID_ARG_TYPE = class ERR_INVALID_ARG_TYPE extends Error {
|
|
124
|
+
constructor (name, expected, actual) {
|
|
125
|
+
super()
|
|
126
|
+
this.code = 'ERR_INVALID_ARG_TYPE'
|
|
127
|
+
this.message = `The ${name} argument must be ${expected}. Received ${typeof actual}`
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const fs = require('fs/promises')
|
|
2
|
+
const getOptions = require('../common/get-options.js')
|
|
3
|
+
const node = require('../common/node.js')
|
|
4
|
+
const polyfill = require('./polyfill.js')
|
|
5
|
+
|
|
6
|
+
// node 16.7.0 added fs.cp
|
|
7
|
+
const useNative = node.satisfies('>=16.7.0')
|
|
8
|
+
|
|
9
|
+
const cp = async (src, dest, opts) => {
|
|
10
|
+
const options = getOptions(opts, {
|
|
11
|
+
copy: ['dereference', 'errorOnExist', 'filter', 'force', 'preserveTimestamps', 'recursive'],
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
// the polyfill is tested separately from this module, no need to hack
|
|
15
|
+
// process.version to try to trigger it just for coverage
|
|
16
|
+
// istanbul ignore next
|
|
17
|
+
return useNative
|
|
18
|
+
? fs.cp(src, dest, options)
|
|
19
|
+
: polyfill(src, dest, options)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = cp
|