cloudstructs 0.1.37 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/lib/codecommit-mirror/index.js +2 -2
- package/lib/ecs-service-roller/index.js +2 -2
- package/lib/email-receiver/receiver.js +1 -1
- package/lib/saml-identity-provider/index.js +2 -2
- package/lib/slack-events/index.js +1 -1
- package/lib/slack-textract/index.js +1 -1
- package/lib/state-machine-cr-provider/index.js +1 -1
- package/lib/static-website/index.js +1 -1
- package/lib/url-shortener/index.handler.js +2 -1
- package/lib/url-shortener/index.js +1 -1
- package/node_modules/@sindresorhus/is/dist/index.d.ts +9 -4
- package/node_modules/@sindresorhus/is/dist/index.js +9 -0
- package/node_modules/@sindresorhus/is/package.json +1 -1
- package/node_modules/@sindresorhus/is/readme.md +26 -0
- package/node_modules/@slack/logger/node_modules/@types/node/README.md +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@slack/logger/node_modules/@types/node/package.json +18 -15
- package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@slack/web-api/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +18 -15
- package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +18 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/@types/is-stream/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@types/is-stream/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@types/is-stream/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@types/is-stream/node_modules/@types/node/package.json +18 -15
- package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@types/is-stream/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@types/is-stream/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/@types/keyv/README.md +1 -1
- package/node_modules/@types/keyv/index.d.ts +10 -3
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +18 -15
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/@types/keyv/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +3 -4
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +823 -40
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +359 -90
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1895 -113
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1070 -240
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +331 -104
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +310 -37
- package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +2406 -742
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +458 -58
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +292 -36
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +414 -97
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +153 -9
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +560 -35
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +735 -279
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2351 -870
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +24 -14
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1020 -98
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +1586 -466
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +366 -15
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +87 -13
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +577 -562
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +53 -12
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +558 -143
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +236 -26
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +18 -15
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +9 -5
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +290 -92
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1170 -156
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +64 -26
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +107 -8
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +426 -80
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +138 -113
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +15 -44
- package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +979 -226
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +57 -1
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +53 -10
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +32 -39
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +449 -227
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +107 -11
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +160 -24
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +703 -32
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1375 -76
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +255 -79
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +384 -33
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +92 -24
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +501 -138
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +216 -64
- package/node_modules/axios/CHANGELOG.md +98 -8
- package/node_modules/axios/README.md +74 -6
- package/node_modules/axios/SECURITY.md +5 -0
- package/node_modules/axios/dist/axios.js +2028 -1591
- package/node_modules/axios/dist/axios.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.map +1 -1
- package/node_modules/axios/index.d.ts +8 -1
- package/node_modules/axios/lib/adapters/http.js +33 -5
- package/node_modules/axios/lib/adapters/xhr.js +35 -25
- package/node_modules/axios/lib/core/Axios.js +60 -7
- package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
- package/node_modules/axios/lib/core/README.md +1 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +6 -3
- package/node_modules/axios/lib/core/transformData.js +3 -1
- package/node_modules/axios/lib/defaults.js +43 -7
- package/node_modules/axios/lib/helpers/validator.js +105 -0
- package/node_modules/axios/lib/utils.js +1 -3
- package/node_modules/axios/package.json +19 -21
- package/node_modules/follow-redirects/debug.js +2 -1
- package/node_modules/follow-redirects/index.js +14 -7
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/mime-db/HISTORY.md +6 -0
- package/node_modules/mime-db/db.json +39 -1
- package/node_modules/mime-db/package.json +4 -4
- package/node_modules/mime-types/HISTORY.md +7 -0
- package/node_modules/mime-types/package.json +4 -4
- package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.d.ts +0 -0
- package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.js +0 -0
- package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/license +0 -0
- package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/package.json +0 -0
- package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/readme.md +0 -0
- package/node_modules/resolve-alpn/README.md +8 -1
- package/node_modules/resolve-alpn/index.js +14 -4
- package/node_modules/resolve-alpn/package.json +1 -1
- package/package.json +15 -15
- package/node_modules/@slack/logger/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@slack/logger/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/node_modules/@slack/web-api/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/node_modules/@types/cacheable-request/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/node_modules/@types/is-stream/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@types/is-stream/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/node_modules/@types/keyv/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/index.d.ts +0 -7
- package/node_modules/@types/responselike/node_modules/@types/node/base.d.ts +0 -19
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
- package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
- package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/base.d.ts +0 -67
- package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/index.d.ts +0 -7
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `fs/promises` API provides asynchronous file system methods that return
|
|
3
|
+
* promises.
|
|
4
|
+
*
|
|
5
|
+
* The promise APIs use the underlying Node.js threadpool to perform file
|
|
6
|
+
* system operations off the event loop thread. These operations are not
|
|
7
|
+
* synchronized or threadsafe. Care must be taken when performing multiple
|
|
8
|
+
* concurrent modifications on the same file or data corruption may occur.
|
|
9
|
+
* @since v10.0.0
|
|
10
|
+
*/
|
|
1
11
|
declare module 'fs/promises' {
|
|
2
|
-
import { Abortable } from 'events';
|
|
3
|
-
import { Stream } from 'stream';
|
|
12
|
+
import { Abortable } from 'node:events';
|
|
13
|
+
import { Stream } from 'node:stream';
|
|
4
14
|
import {
|
|
5
15
|
Stats,
|
|
6
16
|
BigIntStats,
|
|
@@ -19,18 +29,21 @@ declare module 'fs/promises' {
|
|
|
19
29
|
OpenMode,
|
|
20
30
|
Mode,
|
|
21
31
|
WatchOptions,
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
WatchEventType,
|
|
33
|
+
CopyOptions,
|
|
34
|
+
} from 'node:fs';
|
|
35
|
+
interface FileChangeInfo<T extends string | Buffer> {
|
|
36
|
+
eventType: WatchEventType;
|
|
37
|
+
filename: T;
|
|
38
|
+
}
|
|
24
39
|
interface FlagAndOpenMode {
|
|
25
40
|
mode?: Mode | undefined;
|
|
26
41
|
flag?: OpenMode | undefined;
|
|
27
42
|
}
|
|
28
|
-
|
|
29
43
|
interface FileReadResult<T extends ArrayBufferView> {
|
|
30
44
|
bytesRead: number;
|
|
31
45
|
buffer: T;
|
|
32
46
|
}
|
|
33
|
-
|
|
34
47
|
interface FileReadOptions<T extends ArrayBufferView = Buffer> {
|
|
35
48
|
/**
|
|
36
49
|
* @default `Buffer.alloc(0xffff)`
|
|
@@ -46,222 +59,409 @@ declare module 'fs/promises' {
|
|
|
46
59
|
length?: number | null;
|
|
47
60
|
position?: number | null;
|
|
48
61
|
}
|
|
49
|
-
|
|
50
62
|
// TODO: Add `EventEmitter` close
|
|
51
63
|
interface FileHandle {
|
|
52
64
|
/**
|
|
53
|
-
*
|
|
65
|
+
* The numeric file descriptor managed by the {FileHandle} object.
|
|
66
|
+
* @since v10.0.0
|
|
54
67
|
*/
|
|
55
68
|
readonly fd: number;
|
|
56
|
-
|
|
57
69
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* If `mode` is a string, it is parsed as an octal integer.
|
|
65
|
-
* If `flag` is not supplied, the default of `'a'` is used.
|
|
70
|
+
* Alias of `filehandle.writeFile()`.
|
|
71
|
+
*
|
|
72
|
+
* When operating on file handles, the mode cannot be changed from what it was set
|
|
73
|
+
* to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
|
|
74
|
+
* @since v10.0.0
|
|
75
|
+
* @return Fulfills with `undefined` upon success.
|
|
66
76
|
*/
|
|
67
|
-
appendFile(data: string | Uint8Array, options?: ObjectEncodingOptions & FlagAndOpenMode | BufferEncoding | null): Promise<void>;
|
|
68
|
-
|
|
77
|
+
appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
|
69
78
|
/**
|
|
70
|
-
*
|
|
79
|
+
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
|
80
|
+
* @since v10.0.0
|
|
81
|
+
* @param uid The file's new owner's user id.
|
|
82
|
+
* @param gid The file's new group's group id.
|
|
83
|
+
* @return Fulfills with `undefined` upon success.
|
|
71
84
|
*/
|
|
72
85
|
chown(uid: number, gid: number): Promise<void>;
|
|
73
|
-
|
|
74
86
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
87
|
+
* Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
|
|
88
|
+
* @since v10.0.0
|
|
89
|
+
* @param mode the file mode bit mask.
|
|
90
|
+
* @return Fulfills with `undefined` upon success.
|
|
77
91
|
*/
|
|
78
92
|
chmod(mode: Mode): Promise<void>;
|
|
79
|
-
|
|
80
93
|
/**
|
|
81
|
-
*
|
|
94
|
+
* Forces all currently queued I/O operations associated with the file to the
|
|
95
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
|
|
96
|
+
*
|
|
97
|
+
* Unlike `filehandle.sync` this method does not flush modified metadata.
|
|
98
|
+
* @since v10.0.0
|
|
99
|
+
* @return Fulfills with `undefined` upon success.
|
|
82
100
|
*/
|
|
83
101
|
datasync(): Promise<void>;
|
|
84
|
-
|
|
85
102
|
/**
|
|
86
|
-
*
|
|
103
|
+
* Request that all data for the open file descriptor is flushed to the storage
|
|
104
|
+
* device. The specific implementation is operating system and device specific.
|
|
105
|
+
* Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
|
|
106
|
+
* @since v10.0.0
|
|
107
|
+
* @return Fufills with `undefined` upon success.
|
|
87
108
|
*/
|
|
88
109
|
sync(): Promise<void>;
|
|
89
|
-
|
|
90
110
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* @
|
|
96
|
-
* @param
|
|
111
|
+
* Reads data from the file and stores that in the given buffer.
|
|
112
|
+
*
|
|
113
|
+
* If the file is not modified concurrently, the end-of-file is reached when the
|
|
114
|
+
* number of bytes read is zero.
|
|
115
|
+
* @since v10.0.0
|
|
116
|
+
* @param buffer A buffer that will be filled with the file data read.
|
|
117
|
+
* @param [offset=0] The location in the buffer at which to start filling.
|
|
118
|
+
* @param [length=buffer.byteLength] The number of bytes to read.
|
|
119
|
+
* @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
|
|
120
|
+
* integer, the current file position will remain unchanged.
|
|
121
|
+
* @return Fulfills upon success with an object with two properties:
|
|
97
122
|
*/
|
|
98
123
|
read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
|
|
99
124
|
read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
100
125
|
/**
|
|
101
|
-
* Asynchronously reads the entire contents of a file.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
126
|
+
* Asynchronously reads the entire contents of a file.
|
|
127
|
+
*
|
|
128
|
+
* If `options` is a string, then it specifies the `encoding`.
|
|
129
|
+
*
|
|
130
|
+
* The `FileHandle` has to support reading.
|
|
131
|
+
*
|
|
132
|
+
* If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
|
|
133
|
+
* position till the end of the file. It doesn't always read from the beginning
|
|
134
|
+
* of the file.
|
|
135
|
+
* @since v10.0.0
|
|
136
|
+
* @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
|
|
137
|
+
* data will be a string.
|
|
105
138
|
*/
|
|
106
|
-
readFile(
|
|
107
|
-
|
|
139
|
+
readFile(
|
|
140
|
+
options?: {
|
|
141
|
+
encoding?: null | undefined;
|
|
142
|
+
flag?: OpenMode | undefined;
|
|
143
|
+
} | null
|
|
144
|
+
): Promise<Buffer>;
|
|
108
145
|
/**
|
|
109
146
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
110
147
|
* The `FileHandle` must have been opened for reading.
|
|
111
148
|
* @param options An object that may contain an optional flag.
|
|
112
149
|
* If a flag is not provided, it defaults to `'r'`.
|
|
113
150
|
*/
|
|
114
|
-
readFile(
|
|
115
|
-
|
|
151
|
+
readFile(
|
|
152
|
+
options:
|
|
153
|
+
| {
|
|
154
|
+
encoding: BufferEncoding;
|
|
155
|
+
flag?: OpenMode | undefined;
|
|
156
|
+
}
|
|
157
|
+
| BufferEncoding
|
|
158
|
+
): Promise<string>;
|
|
116
159
|
/**
|
|
117
160
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
118
161
|
* The `FileHandle` must have been opened for reading.
|
|
119
162
|
* @param options An object that may contain an optional flag.
|
|
120
163
|
* If a flag is not provided, it defaults to `'r'`.
|
|
121
164
|
*/
|
|
122
|
-
readFile(
|
|
123
|
-
|
|
165
|
+
readFile(
|
|
166
|
+
options?:
|
|
167
|
+
| (ObjectEncodingOptions & {
|
|
168
|
+
flag?: OpenMode | undefined;
|
|
169
|
+
})
|
|
170
|
+
| BufferEncoding
|
|
171
|
+
| null
|
|
172
|
+
): Promise<string | Buffer>;
|
|
124
173
|
/**
|
|
125
|
-
*
|
|
174
|
+
* @since v10.0.0
|
|
175
|
+
* @return Fulfills with an {fs.Stats} for the file.
|
|
126
176
|
*/
|
|
127
|
-
stat(
|
|
128
|
-
|
|
177
|
+
stat(
|
|
178
|
+
opts?: StatOptions & {
|
|
179
|
+
bigint?: false | undefined;
|
|
180
|
+
}
|
|
181
|
+
): Promise<Stats>;
|
|
182
|
+
stat(
|
|
183
|
+
opts: StatOptions & {
|
|
184
|
+
bigint: true;
|
|
185
|
+
}
|
|
186
|
+
): Promise<BigIntStats>;
|
|
129
187
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
130
|
-
|
|
131
188
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
189
|
+
* Truncates the file.
|
|
190
|
+
*
|
|
191
|
+
* If the file was larger than `len` bytes, only the first `len` bytes will be
|
|
192
|
+
* retained in the file.
|
|
193
|
+
*
|
|
194
|
+
* The following example retains only the first four bytes of the file:
|
|
195
|
+
*
|
|
196
|
+
* ```js
|
|
197
|
+
* import { open } from 'fs/promises';
|
|
198
|
+
*
|
|
199
|
+
* let filehandle = null;
|
|
200
|
+
* try {
|
|
201
|
+
* filehandle = await open('temp.txt', 'r+');
|
|
202
|
+
* await filehandle.truncate(4);
|
|
203
|
+
* } finally {
|
|
204
|
+
* await filehandle?.close();
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* If the file previously was shorter than `len` bytes, it is extended, and the
|
|
209
|
+
* extended part is filled with null bytes (`'\0'`):
|
|
210
|
+
*
|
|
211
|
+
* If `len` is negative then `0` will be used.
|
|
212
|
+
* @since v10.0.0
|
|
213
|
+
* @param [len=0]
|
|
214
|
+
* @return Fulfills with `undefined` upon success.
|
|
134
215
|
*/
|
|
135
216
|
truncate(len?: number): Promise<void>;
|
|
136
|
-
|
|
137
217
|
/**
|
|
138
|
-
*
|
|
139
|
-
* @
|
|
140
|
-
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
|
218
|
+
* Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
|
|
219
|
+
* @since v10.0.0
|
|
141
220
|
*/
|
|
142
221
|
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Asynchronously writes `buffer` to the file.
|
|
146
|
-
* The `FileHandle` must have been opened for writing.
|
|
147
|
-
* @param buffer The buffer that the data will be written to.
|
|
148
|
-
* @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
|
|
149
|
-
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
150
|
-
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
151
|
-
*/
|
|
152
|
-
write<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
|
|
153
|
-
|
|
154
222
|
/**
|
|
155
|
-
* Asynchronously writes
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
223
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
224
|
+
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
225
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
|
226
|
+
* object with an own `toString` function
|
|
227
|
+
* property. The promise is resolved with no arguments upon success.
|
|
228
|
+
*
|
|
229
|
+
* If `options` is a string, then it specifies the `encoding`.
|
|
230
|
+
*
|
|
231
|
+
* The `FileHandle` has to support writing.
|
|
232
|
+
*
|
|
233
|
+
* It is unsafe to use `filehandle.writeFile()` multiple times on the same file
|
|
234
|
+
* without waiting for the promise to be resolved (or rejected).
|
|
235
|
+
*
|
|
236
|
+
* If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
|
|
237
|
+
* current position till the end of the file. It doesn't always write from the
|
|
238
|
+
* beginning of the file.
|
|
239
|
+
* @since v10.0.0
|
|
162
240
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
241
|
+
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
|
|
165
242
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
243
|
+
* Write `buffer` to the file.
|
|
244
|
+
*
|
|
245
|
+
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
246
|
+
*
|
|
247
|
+
* The promise is resolved with an object containing two properties:
|
|
248
|
+
*
|
|
249
|
+
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
250
|
+
* without waiting for the promise to be resolved (or rejected). For this
|
|
251
|
+
* scenario, use `fs.createWriteStream()`.
|
|
252
|
+
*
|
|
253
|
+
* On Linux, positional writes do not work when the file is opened in append mode.
|
|
254
|
+
* The kernel ignores the position argument and always appends the data to
|
|
255
|
+
* the end of the file.
|
|
256
|
+
* @since v10.0.0
|
|
257
|
+
* @param [offset=0] The start position from within `buffer` where the data to write begins.
|
|
258
|
+
* @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
|
|
259
|
+
* @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
|
|
260
|
+
* See the POSIX pwrite(2) documentation for more detail.
|
|
175
261
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
262
|
+
write<TBuffer extends Uint8Array>(
|
|
263
|
+
buffer: TBuffer,
|
|
264
|
+
offset?: number | null,
|
|
265
|
+
length?: number | null,
|
|
266
|
+
position?: number | null
|
|
267
|
+
): Promise<{
|
|
268
|
+
bytesWritten: number;
|
|
269
|
+
buffer: TBuffer;
|
|
270
|
+
}>;
|
|
271
|
+
write(
|
|
272
|
+
data: string,
|
|
273
|
+
position?: number | null,
|
|
274
|
+
encoding?: BufferEncoding | null
|
|
275
|
+
): Promise<{
|
|
276
|
+
bytesWritten: number;
|
|
277
|
+
buffer: string;
|
|
278
|
+
}>;
|
|
178
279
|
/**
|
|
179
|
-
*
|
|
280
|
+
* Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
|
|
281
|
+
*
|
|
282
|
+
* The promise is resolved with an object containing a two properties:
|
|
283
|
+
*
|
|
284
|
+
* It is unsafe to call `writev()` multiple times on the same file without waiting
|
|
285
|
+
* for the promise to be resolved (or rejected).
|
|
286
|
+
*
|
|
287
|
+
* On Linux, positional writes don't work when the file is opened in append mode.
|
|
288
|
+
* The kernel ignores the position argument and always appends the data to
|
|
289
|
+
* the end of the file.
|
|
290
|
+
* @since v12.9.0
|
|
291
|
+
* @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
|
292
|
+
* position.
|
|
180
293
|
*/
|
|
181
294
|
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
|
182
|
-
|
|
183
295
|
/**
|
|
184
|
-
*
|
|
296
|
+
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
|
297
|
+
* @since v13.13.0, v12.17.0
|
|
298
|
+
* @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
|
299
|
+
* @return Fulfills upon success an object containing two properties:
|
|
185
300
|
*/
|
|
186
301
|
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
|
187
|
-
|
|
188
302
|
/**
|
|
189
|
-
*
|
|
303
|
+
* Closes the file handle after waiting for any pending operation on the handle to
|
|
304
|
+
* complete.
|
|
305
|
+
*
|
|
306
|
+
* ```js
|
|
307
|
+
* import { open } from 'fs/promises';
|
|
308
|
+
*
|
|
309
|
+
* let filehandle;
|
|
310
|
+
* try {
|
|
311
|
+
* filehandle = await open('thefile.txt', 'r');
|
|
312
|
+
* } finally {
|
|
313
|
+
* await filehandle?.close();
|
|
314
|
+
* }
|
|
315
|
+
* ```
|
|
316
|
+
* @since v10.0.0
|
|
317
|
+
* @return Fulfills with `undefined` upon success.
|
|
190
318
|
*/
|
|
191
319
|
close(): Promise<void>;
|
|
192
320
|
}
|
|
193
|
-
|
|
194
321
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
322
|
+
* Tests a user's permissions for the file or directory specified by `path`.
|
|
323
|
+
* The `mode` argument is an optional integer that specifies the accessibility
|
|
324
|
+
* checks to be performed. Check `File access constants` for possible values
|
|
325
|
+
* of `mode`. It is possible to create a mask consisting of the bitwise OR of
|
|
326
|
+
* two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
|
|
327
|
+
*
|
|
328
|
+
* If the accessibility check is successful, the promise is resolved with no
|
|
329
|
+
* value. If any of the accessibility checks fail, the promise is rejected
|
|
330
|
+
* with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
|
|
331
|
+
* written by the current process.
|
|
332
|
+
*
|
|
333
|
+
* ```js
|
|
334
|
+
* import { access } from 'fs/promises';
|
|
335
|
+
* import { constants } from 'fs';
|
|
336
|
+
*
|
|
337
|
+
* try {
|
|
338
|
+
* await access('/etc/passwd', constants.R_OK | constants.W_OK);
|
|
339
|
+
* console.log('can access');
|
|
340
|
+
* } catch {
|
|
341
|
+
* console.error('cannot access');
|
|
342
|
+
* }
|
|
343
|
+
* ```
|
|
344
|
+
*
|
|
345
|
+
* Using `fsPromises.access()` to check for the accessibility of a file before
|
|
346
|
+
* calling `fsPromises.open()` is not recommended. Doing so introduces a race
|
|
347
|
+
* condition, since other processes may change the file's state between the two
|
|
348
|
+
* calls. Instead, user code should open/read/write the file directly and handle
|
|
349
|
+
* the error raised if the file is not accessible.
|
|
350
|
+
* @since v10.0.0
|
|
351
|
+
* @param [mode=fs.constants.F_OK]
|
|
352
|
+
* @return Fulfills with `undefined` upon success.
|
|
198
353
|
*/
|
|
199
354
|
function access(path: PathLike, mode?: number): Promise<void>;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
355
|
+
/**
|
|
356
|
+
* Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it
|
|
357
|
+
* already exists.
|
|
358
|
+
*
|
|
359
|
+
* No guarantees are made about the atomicity of the copy operation. If an
|
|
360
|
+
* error occurs after the destination file has been opened for writing, an attempt
|
|
361
|
+
* will be made to remove the destination.
|
|
362
|
+
*
|
|
363
|
+
* ```js
|
|
364
|
+
* import { constants } from 'fs';
|
|
365
|
+
* import { copyFile } from 'fs/promises';
|
|
366
|
+
*
|
|
367
|
+
* try {
|
|
368
|
+
* await copyFile('source.txt', 'destination.txt');
|
|
369
|
+
* console.log('source.txt was copied to destination.txt');
|
|
370
|
+
* } catch {
|
|
371
|
+
* console.log('The file could not be copied');
|
|
372
|
+
* }
|
|
373
|
+
*
|
|
374
|
+
* // By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
|
|
375
|
+
* try {
|
|
376
|
+
* await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);
|
|
377
|
+
* console.log('source.txt was copied to destination.txt');
|
|
378
|
+
* } catch {
|
|
379
|
+
* console.log('The file could not be copied');
|
|
380
|
+
* }
|
|
381
|
+
* ```
|
|
382
|
+
* @since v10.0.0
|
|
383
|
+
* @param src source filename to copy
|
|
384
|
+
* @param dest destination filename of the copy operation
|
|
385
|
+
* @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g.
|
|
386
|
+
* `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
|
|
387
|
+
* @return Fulfills with `undefined` upon success.
|
|
388
|
+
*/
|
|
389
|
+
function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
|
|
390
|
+
/**
|
|
391
|
+
* Opens a `FileHandle`.
|
|
392
|
+
*
|
|
393
|
+
* Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail.
|
|
394
|
+
*
|
|
395
|
+
* Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
|
|
396
|
+
* by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
|
|
397
|
+
* a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
398
|
+
* @since v10.0.0
|
|
399
|
+
* @param [flags='r'] See `support of file system `flags``.
|
|
400
|
+
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
|
401
|
+
* @return Fulfills with a {FileHandle} object.
|
|
219
402
|
*/
|
|
220
403
|
function open(path: PathLike, flags: string | number, mode?: Mode): Promise<FileHandle>;
|
|
221
|
-
|
|
222
404
|
/**
|
|
223
|
-
*
|
|
224
|
-
* @
|
|
225
|
-
*
|
|
226
|
-
* @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
227
|
-
* URL support is _experimental_.
|
|
405
|
+
* Renames `oldPath` to `newPath`.
|
|
406
|
+
* @since v10.0.0
|
|
407
|
+
* @return Fulfills with `undefined` upon success.
|
|
228
408
|
*/
|
|
229
409
|
function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
|
|
230
|
-
|
|
231
410
|
/**
|
|
232
|
-
*
|
|
233
|
-
* @
|
|
234
|
-
* @param len
|
|
411
|
+
* Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
|
|
412
|
+
* @since v10.0.0
|
|
413
|
+
* @param [len=0]
|
|
414
|
+
* @return Fulfills with `undefined` upon success.
|
|
235
415
|
*/
|
|
236
416
|
function truncate(path: PathLike, len?: number): Promise<void>;
|
|
237
|
-
|
|
238
417
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
418
|
+
* Removes the directory identified by `path`.
|
|
419
|
+
*
|
|
420
|
+
* Using `fsPromises.rmdir()` on a file (not a directory) results in the
|
|
421
|
+
* promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
|
|
422
|
+
*
|
|
423
|
+
* To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
|
|
424
|
+
* @since v10.0.0
|
|
425
|
+
* @return Fulfills with `undefined` upon success.
|
|
241
426
|
*/
|
|
242
427
|
function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
|
|
243
|
-
|
|
244
428
|
/**
|
|
245
|
-
*
|
|
429
|
+
* Removes files and directories (modeled on the standard POSIX `rm` utility).
|
|
430
|
+
* @since v14.14.0
|
|
431
|
+
* @return Fulfills with `undefined` upon success.
|
|
246
432
|
*/
|
|
247
433
|
function rm(path: PathLike, options?: RmOptions): Promise<void>;
|
|
248
|
-
|
|
249
434
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
435
|
+
* Asynchronously creates a directory.
|
|
436
|
+
*
|
|
437
|
+
* The optional `options` argument can be an integer specifying `mode` (permission
|
|
438
|
+
* and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
|
|
439
|
+
* that exists results in a
|
|
440
|
+
* rejection only when `recursive` is false.
|
|
441
|
+
* @since v10.0.0
|
|
442
|
+
* @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.
|
|
443
|
+
*/
|
|
444
|
+
function mkdir(
|
|
445
|
+
path: PathLike,
|
|
446
|
+
options: MakeDirectoryOptions & {
|
|
447
|
+
recursive: true;
|
|
448
|
+
}
|
|
449
|
+
): Promise<string | undefined>;
|
|
257
450
|
/**
|
|
258
451
|
* Asynchronous mkdir(2) - create a directory.
|
|
259
452
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
260
453
|
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
|
261
454
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
262
455
|
*/
|
|
263
|
-
function mkdir(
|
|
264
|
-
|
|
456
|
+
function mkdir(
|
|
457
|
+
path: PathLike,
|
|
458
|
+
options?:
|
|
459
|
+
| Mode
|
|
460
|
+
| (MakeDirectoryOptions & {
|
|
461
|
+
recursive?: false | undefined;
|
|
462
|
+
})
|
|
463
|
+
| null
|
|
464
|
+
): Promise<void>;
|
|
265
465
|
/**
|
|
266
466
|
* Asynchronous mkdir(2) - create a directory.
|
|
267
467
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -269,226 +469,404 @@ declare module 'fs/promises' {
|
|
|
269
469
|
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
270
470
|
*/
|
|
271
471
|
function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise<string | undefined>;
|
|
272
|
-
|
|
273
472
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
473
|
+
* Reads the contents of a directory.
|
|
474
|
+
*
|
|
475
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
|
476
|
+
* object with an `encoding` property specifying the character encoding to use for
|
|
477
|
+
* the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
|
|
478
|
+
* will be passed as `Buffer` objects.
|
|
479
|
+
*
|
|
480
|
+
* If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects.
|
|
481
|
+
*
|
|
482
|
+
* ```js
|
|
483
|
+
* import { readdir } from 'fs/promises';
|
|
484
|
+
*
|
|
485
|
+
* try {
|
|
486
|
+
* const files = await readdir(path);
|
|
487
|
+
* for (const file of files)
|
|
488
|
+
* console.log(file);
|
|
489
|
+
* } catch (err) {
|
|
490
|
+
* console.error(err);
|
|
491
|
+
* }
|
|
492
|
+
* ```
|
|
493
|
+
* @since v10.0.0
|
|
494
|
+
* @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.
|
|
495
|
+
*/
|
|
496
|
+
function readdir(
|
|
497
|
+
path: PathLike,
|
|
498
|
+
options?:
|
|
499
|
+
| (ObjectEncodingOptions & {
|
|
500
|
+
withFileTypes?: false | undefined;
|
|
501
|
+
})
|
|
502
|
+
| BufferEncoding
|
|
503
|
+
| null
|
|
504
|
+
): Promise<string[]>;
|
|
280
505
|
/**
|
|
281
506
|
* Asynchronous readdir(3) - read a directory.
|
|
282
507
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
283
508
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
284
509
|
*/
|
|
285
|
-
function readdir(
|
|
286
|
-
|
|
510
|
+
function readdir(
|
|
511
|
+
path: PathLike,
|
|
512
|
+
options:
|
|
513
|
+
| {
|
|
514
|
+
encoding: 'buffer';
|
|
515
|
+
withFileTypes?: false | undefined;
|
|
516
|
+
}
|
|
517
|
+
| 'buffer'
|
|
518
|
+
): Promise<Buffer[]>;
|
|
287
519
|
/**
|
|
288
520
|
* Asynchronous readdir(3) - read a directory.
|
|
289
521
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
290
522
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
291
523
|
*/
|
|
292
|
-
function readdir(
|
|
293
|
-
|
|
524
|
+
function readdir(
|
|
525
|
+
path: PathLike,
|
|
526
|
+
options?:
|
|
527
|
+
| (ObjectEncodingOptions & {
|
|
528
|
+
withFileTypes?: false | undefined;
|
|
529
|
+
})
|
|
530
|
+
| BufferEncoding
|
|
531
|
+
| null
|
|
532
|
+
): Promise<string[] | Buffer[]>;
|
|
294
533
|
/**
|
|
295
534
|
* Asynchronous readdir(3) - read a directory.
|
|
296
535
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
297
536
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
298
537
|
*/
|
|
299
|
-
function readdir(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
538
|
+
function readdir(
|
|
539
|
+
path: PathLike,
|
|
540
|
+
options: ObjectEncodingOptions & {
|
|
541
|
+
withFileTypes: true;
|
|
542
|
+
}
|
|
543
|
+
): Promise<Dirent[]>;
|
|
544
|
+
/**
|
|
545
|
+
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
|
546
|
+
* resolved with the`linkString` upon success.
|
|
547
|
+
*
|
|
548
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
|
549
|
+
* object with an `encoding` property specifying the character encoding to use for
|
|
550
|
+
* the link path returned. If the `encoding` is set to `'buffer'`, the link path
|
|
551
|
+
* returned will be passed as a `Buffer` object.
|
|
552
|
+
* @since v10.0.0
|
|
553
|
+
* @return Fulfills with the `linkString` upon success.
|
|
305
554
|
*/
|
|
306
555
|
function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
|
307
|
-
|
|
308
556
|
/**
|
|
309
557
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
310
558
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
311
559
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
312
560
|
*/
|
|
313
561
|
function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
|
|
314
|
-
|
|
315
562
|
/**
|
|
316
563
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
317
564
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
318
565
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
319
566
|
*/
|
|
320
567
|
function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
|
|
321
|
-
|
|
322
568
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
569
|
+
* Creates a symbolic link.
|
|
570
|
+
*
|
|
571
|
+
* The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path
|
|
572
|
+
* to be absolute. When using `'junction'`, the `target` argument will
|
|
573
|
+
* automatically be normalized to absolute path.
|
|
574
|
+
* @since v10.0.0
|
|
575
|
+
* @param [type='file']
|
|
576
|
+
* @return Fulfills with `undefined` upon success.
|
|
328
577
|
*/
|
|
329
578
|
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
|
330
|
-
|
|
331
579
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
580
|
+
* Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link,
|
|
581
|
+
* in which case the link itself is stat-ed, not the file that it refers to.
|
|
582
|
+
* Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail.
|
|
583
|
+
* @since v10.0.0
|
|
584
|
+
* @return Fulfills with the {fs.Stats} object for the given symbolic link `path`.
|
|
585
|
+
*/
|
|
586
|
+
function lstat(
|
|
587
|
+
path: PathLike,
|
|
588
|
+
opts?: StatOptions & {
|
|
589
|
+
bigint?: false | undefined;
|
|
590
|
+
}
|
|
591
|
+
): Promise<Stats>;
|
|
592
|
+
function lstat(
|
|
593
|
+
path: PathLike,
|
|
594
|
+
opts: StatOptions & {
|
|
595
|
+
bigint: true;
|
|
596
|
+
}
|
|
597
|
+
): Promise<BigIntStats>;
|
|
337
598
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
338
|
-
|
|
339
599
|
/**
|
|
340
|
-
*
|
|
341
|
-
* @
|
|
342
|
-
*/
|
|
343
|
-
function stat(
|
|
344
|
-
|
|
600
|
+
* @since v10.0.0
|
|
601
|
+
* @return Fulfills with the {fs.Stats} object for the given `path`.
|
|
602
|
+
*/
|
|
603
|
+
function stat(
|
|
604
|
+
path: PathLike,
|
|
605
|
+
opts?: StatOptions & {
|
|
606
|
+
bigint?: false | undefined;
|
|
607
|
+
}
|
|
608
|
+
): Promise<Stats>;
|
|
609
|
+
function stat(
|
|
610
|
+
path: PathLike,
|
|
611
|
+
opts: StatOptions & {
|
|
612
|
+
bigint: true;
|
|
613
|
+
}
|
|
614
|
+
): Promise<BigIntStats>;
|
|
345
615
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
346
|
-
|
|
347
616
|
/**
|
|
348
|
-
*
|
|
349
|
-
* @
|
|
350
|
-
* @
|
|
617
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
|
618
|
+
* @since v10.0.0
|
|
619
|
+
* @return Fulfills with `undefined` upon success.
|
|
351
620
|
*/
|
|
352
621
|
function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
|
353
|
-
|
|
354
622
|
/**
|
|
355
|
-
*
|
|
356
|
-
*
|
|
623
|
+
* If `path` refers to a symbolic link, then the link is removed without affecting
|
|
624
|
+
* the file or directory to which that link refers. If the `path` refers to a file
|
|
625
|
+
* path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
|
|
626
|
+
* @since v10.0.0
|
|
627
|
+
* @return Fulfills with `undefined` upon success.
|
|
357
628
|
*/
|
|
358
629
|
function unlink(path: PathLike): Promise<void>;
|
|
359
|
-
|
|
360
630
|
/**
|
|
361
|
-
*
|
|
362
|
-
* @
|
|
363
|
-
* @
|
|
631
|
+
* Changes the permissions of a file.
|
|
632
|
+
* @since v10.0.0
|
|
633
|
+
* @return Fulfills with `undefined` upon success.
|
|
364
634
|
*/
|
|
365
635
|
function chmod(path: PathLike, mode: Mode): Promise<void>;
|
|
366
|
-
|
|
367
636
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
637
|
+
* Changes the permissions on a symbolic link.
|
|
638
|
+
*
|
|
639
|
+
* This method is only implemented on macOS.
|
|
640
|
+
* @deprecated Since v10.0.0
|
|
641
|
+
* @return Fulfills with `undefined` upon success.
|
|
371
642
|
*/
|
|
372
643
|
function lchmod(path: PathLike, mode: Mode): Promise<void>;
|
|
373
|
-
|
|
374
644
|
/**
|
|
375
|
-
*
|
|
376
|
-
* @
|
|
645
|
+
* Changes the ownership on a symbolic link.
|
|
646
|
+
* @since v10.0.0
|
|
647
|
+
* @return Fulfills with `undefined` upon success.
|
|
377
648
|
*/
|
|
378
649
|
function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
|
|
379
|
-
|
|
380
650
|
/**
|
|
381
|
-
* Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
* @
|
|
385
|
-
* @
|
|
386
|
-
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
|
651
|
+
* Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a
|
|
652
|
+
* symbolic link, then the link is not dereferenced: instead, the timestamps of
|
|
653
|
+
* the symbolic link itself are changed.
|
|
654
|
+
* @since v14.5.0, v12.19.0
|
|
655
|
+
* @return Fulfills with `undefined` upon success.
|
|
387
656
|
*/
|
|
388
657
|
function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
|
389
|
-
|
|
390
658
|
/**
|
|
391
|
-
*
|
|
392
|
-
* @
|
|
659
|
+
* Changes the ownership of a file.
|
|
660
|
+
* @since v10.0.0
|
|
661
|
+
* @return Fulfills with `undefined` upon success.
|
|
393
662
|
*/
|
|
394
663
|
function chown(path: PathLike, uid: number, gid: number): Promise<void>;
|
|
395
|
-
|
|
396
664
|
/**
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
665
|
+
* Change the file system timestamps of the object referenced by `path`.
|
|
666
|
+
*
|
|
667
|
+
* The `atime` and `mtime` arguments follow these rules:
|
|
668
|
+
*
|
|
669
|
+
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
|
670
|
+
* numeric string like `'123456789.0'`.
|
|
671
|
+
* * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown.
|
|
672
|
+
* @since v10.0.0
|
|
673
|
+
* @return Fulfills with `undefined` upon success.
|
|
401
674
|
*/
|
|
402
675
|
function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
|
403
|
-
|
|
404
676
|
/**
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
677
|
+
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
|
678
|
+
*
|
|
679
|
+
* Only paths that can be converted to UTF8 strings are supported.
|
|
680
|
+
*
|
|
681
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
|
682
|
+
* object with an `encoding` property specifying the character encoding to use for
|
|
683
|
+
* the path. If the `encoding` is set to `'buffer'`, the path returned will be
|
|
684
|
+
* passed as a `Buffer` object.
|
|
685
|
+
*
|
|
686
|
+
* On Linux, when Node.js is linked against musl libc, the procfs file system must
|
|
687
|
+
* be mounted on `/proc` in order for this function to work. Glibc does not have
|
|
688
|
+
* this restriction.
|
|
689
|
+
* @since v10.0.0
|
|
690
|
+
* @return Fulfills with the resolved path upon success.
|
|
408
691
|
*/
|
|
409
692
|
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
|
410
|
-
|
|
411
693
|
/**
|
|
412
694
|
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
|
413
695
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
414
696
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
415
697
|
*/
|
|
416
698
|
function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
|
|
417
|
-
|
|
418
699
|
/**
|
|
419
700
|
* Asynchronous realpath(3) - return the canonicalized absolute pathname.
|
|
420
701
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
421
702
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
422
703
|
*/
|
|
423
704
|
function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
|
424
|
-
|
|
425
705
|
/**
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
706
|
+
* Creates a unique temporary directory. A unique directory name is generated by
|
|
707
|
+
* appending six random characters to the end of the provided `prefix`. Due to
|
|
708
|
+
* platform inconsistencies, avoid trailing `X` characters in `prefix`. Some
|
|
709
|
+
* platforms, notably the BSDs, can return more than six random characters, and
|
|
710
|
+
* replace trailing `X` characters in `prefix` with random characters.
|
|
711
|
+
*
|
|
712
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
|
713
|
+
* object with an `encoding` property specifying the character encoding to use.
|
|
714
|
+
*
|
|
715
|
+
* ```js
|
|
716
|
+
* import { mkdtemp } from 'fs/promises';
|
|
717
|
+
*
|
|
718
|
+
* try {
|
|
719
|
+
* await mkdtemp(path.join(os.tmpdir(), 'foo-'));
|
|
720
|
+
* } catch (err) {
|
|
721
|
+
* console.error(err);
|
|
722
|
+
* }
|
|
723
|
+
* ```
|
|
724
|
+
*
|
|
725
|
+
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
|
726
|
+
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
|
727
|
+
* platform-specific path separator
|
|
728
|
+
* (`require('path').sep`).
|
|
729
|
+
* @since v10.0.0
|
|
730
|
+
* @return Fulfills with a string containing the filesystem path of the newly created temporary directory.
|
|
429
731
|
*/
|
|
430
732
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
|
|
431
|
-
|
|
432
733
|
/**
|
|
433
734
|
* Asynchronously creates a unique temporary directory.
|
|
434
735
|
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
|
435
736
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
436
737
|
*/
|
|
437
738
|
function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
|
|
438
|
-
|
|
439
739
|
/**
|
|
440
740
|
* Asynchronously creates a unique temporary directory.
|
|
441
741
|
* Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
|
|
442
742
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
443
743
|
*/
|
|
444
744
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
|
445
|
-
|
|
446
745
|
/**
|
|
447
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
* If
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
746
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property.
|
|
747
|
+
*
|
|
748
|
+
* The `encoding` option is ignored if `data` is a buffer.
|
|
749
|
+
*
|
|
750
|
+
* If `options` is a string, then it specifies the encoding.
|
|
751
|
+
*
|
|
752
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
753
|
+
*
|
|
754
|
+
* Any specified `FileHandle` has to support writing.
|
|
755
|
+
*
|
|
756
|
+
* It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
|
|
757
|
+
* without waiting for the promise to be settled.
|
|
758
|
+
*
|
|
759
|
+
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
|
760
|
+
* method that performs multiple `write` calls internally to write the buffer
|
|
761
|
+
* passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
|
|
762
|
+
*
|
|
763
|
+
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
|
764
|
+
* Cancelation is "best effort", and some amount of data is likely still
|
|
765
|
+
* to be written.
|
|
766
|
+
*
|
|
767
|
+
* ```js
|
|
768
|
+
* import { writeFile } from 'fs/promises';
|
|
769
|
+
* import { Buffer } from 'buffer';
|
|
770
|
+
*
|
|
771
|
+
* try {
|
|
772
|
+
* const controller = new AbortController();
|
|
773
|
+
* const { signal } = controller;
|
|
774
|
+
* const data = new Uint8Array(Buffer.from('Hello Node.js'));
|
|
775
|
+
* const promise = writeFile('message.txt', data, { signal });
|
|
776
|
+
*
|
|
777
|
+
* // Abort the request before the promise settles.
|
|
778
|
+
* controller.abort();
|
|
779
|
+
*
|
|
780
|
+
* await promise;
|
|
781
|
+
* } catch (err) {
|
|
782
|
+
* // When a request is aborted - err is an AbortError
|
|
783
|
+
* console.error(err);
|
|
784
|
+
* }
|
|
785
|
+
* ```
|
|
786
|
+
*
|
|
787
|
+
* Aborting an ongoing request does not abort individual operating
|
|
788
|
+
* system requests but rather the internal buffering `fs.writeFile` performs.
|
|
789
|
+
* @since v10.0.0
|
|
790
|
+
* @param file filename or `FileHandle`
|
|
791
|
+
* @return Fulfills with `undefined` upon success.
|
|
458
792
|
*/
|
|
459
793
|
function writeFile(
|
|
460
|
-
|
|
794
|
+
file: PathLike | FileHandle,
|
|
461
795
|
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
|
|
462
|
-
options?:
|
|
796
|
+
options?:
|
|
797
|
+
| (ObjectEncodingOptions & {
|
|
798
|
+
mode?: Mode | undefined;
|
|
799
|
+
flag?: OpenMode | undefined;
|
|
800
|
+
} & Abortable)
|
|
801
|
+
| BufferEncoding
|
|
802
|
+
| null
|
|
463
803
|
): Promise<void>;
|
|
464
|
-
|
|
465
804
|
/**
|
|
466
|
-
* Asynchronously append data to a file, creating the file if it does not
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
* If
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
options?: ObjectEncodingOptions & FlagAndOpenMode | BufferEncoding | null,
|
|
481
|
-
): Promise<void>;
|
|
482
|
-
|
|
805
|
+
* Asynchronously append data to a file, creating the file if it does not yet
|
|
806
|
+
* exist. `data` can be a string or a `Buffer`.
|
|
807
|
+
*
|
|
808
|
+
* If `options` is a string, then it specifies the `encoding`.
|
|
809
|
+
*
|
|
810
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
811
|
+
*
|
|
812
|
+
* The `path` may be specified as a `FileHandle` that has been opened
|
|
813
|
+
* for appending (using `fsPromises.open()`).
|
|
814
|
+
* @since v10.0.0
|
|
815
|
+
* @param path filename or {FileHandle}
|
|
816
|
+
* @return Fulfills with `undefined` upon success.
|
|
817
|
+
*/
|
|
818
|
+
function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise<void>;
|
|
483
819
|
/**
|
|
484
820
|
* Asynchronously reads the entire contents of a file.
|
|
485
|
-
*
|
|
486
|
-
* If
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
821
|
+
*
|
|
822
|
+
* If no encoding is specified (using `options.encoding`), the data is returned
|
|
823
|
+
* as a `Buffer` object. Otherwise, the data will be a string.
|
|
824
|
+
*
|
|
825
|
+
* If `options` is a string, then it specifies the encoding.
|
|
826
|
+
*
|
|
827
|
+
* When the `path` is a directory, the behavior of `fsPromises.readFile()` is
|
|
828
|
+
* platform-specific. On macOS, Linux, and Windows, the promise will be rejected
|
|
829
|
+
* with an error. On FreeBSD, a representation of the directory's contents will be
|
|
830
|
+
* returned.
|
|
831
|
+
*
|
|
832
|
+
* It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a
|
|
833
|
+
* request is aborted the promise returned is rejected with an `AbortError`:
|
|
834
|
+
*
|
|
835
|
+
* ```js
|
|
836
|
+
* import { readFile } from 'fs/promises';
|
|
837
|
+
*
|
|
838
|
+
* try {
|
|
839
|
+
* const controller = new AbortController();
|
|
840
|
+
* const { signal } = controller;
|
|
841
|
+
* const promise = readFile(fileName, { signal });
|
|
842
|
+
*
|
|
843
|
+
* // Abort the request before the promise settles.
|
|
844
|
+
* controller.abort();
|
|
845
|
+
*
|
|
846
|
+
* await promise;
|
|
847
|
+
* } catch (err) {
|
|
848
|
+
* // When a request is aborted - err is an AbortError
|
|
849
|
+
* console.error(err);
|
|
850
|
+
* }
|
|
851
|
+
* ```
|
|
852
|
+
*
|
|
853
|
+
* Aborting an ongoing request does not abort individual operating
|
|
854
|
+
* system requests but rather the internal buffering `fs.readFile` performs.
|
|
855
|
+
*
|
|
856
|
+
* Any specified `FileHandle` has to support reading.
|
|
857
|
+
* @since v10.0.0
|
|
858
|
+
* @param path filename or `FileHandle`
|
|
859
|
+
* @return Fulfills with the contents of the file.
|
|
860
|
+
*/
|
|
861
|
+
function readFile(
|
|
862
|
+
path: PathLike | FileHandle,
|
|
863
|
+
options?:
|
|
864
|
+
| ({
|
|
865
|
+
encoding?: null | undefined;
|
|
866
|
+
flag?: OpenMode | undefined;
|
|
867
|
+
} & Abortable)
|
|
868
|
+
| null
|
|
869
|
+
): Promise<Buffer>;
|
|
492
870
|
/**
|
|
493
871
|
* Asynchronously reads the entire contents of a file.
|
|
494
872
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -496,8 +874,15 @@ declare module 'fs/promises' {
|
|
|
496
874
|
* @param options An object that may contain an optional flag.
|
|
497
875
|
* If a flag is not provided, it defaults to `'r'`.
|
|
498
876
|
*/
|
|
499
|
-
function readFile(
|
|
500
|
-
|
|
877
|
+
function readFile(
|
|
878
|
+
path: PathLike | FileHandle,
|
|
879
|
+
options:
|
|
880
|
+
| ({
|
|
881
|
+
encoding: BufferEncoding;
|
|
882
|
+
flag?: OpenMode | undefined;
|
|
883
|
+
} & Abortable)
|
|
884
|
+
| BufferEncoding
|
|
885
|
+
): Promise<string>;
|
|
501
886
|
/**
|
|
502
887
|
* Asynchronously reads the entire contents of a file.
|
|
503
888
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -505,20 +890,83 @@ declare module 'fs/promises' {
|
|
|
505
890
|
* @param options An object that may contain an optional flag.
|
|
506
891
|
* If a flag is not provided, it defaults to `'r'`.
|
|
507
892
|
*/
|
|
508
|
-
function readFile(
|
|
509
|
-
|
|
893
|
+
function readFile(
|
|
894
|
+
path: PathLike | FileHandle,
|
|
895
|
+
options?:
|
|
896
|
+
| (ObjectEncodingOptions &
|
|
897
|
+
Abortable & {
|
|
898
|
+
flag?: OpenMode | undefined;
|
|
899
|
+
})
|
|
900
|
+
| BufferEncoding
|
|
901
|
+
| null
|
|
902
|
+
): Promise<string | Buffer>;
|
|
903
|
+
/**
|
|
904
|
+
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
|
905
|
+
*
|
|
906
|
+
* Creates an `fs.Dir`, which contains all further functions for reading from
|
|
907
|
+
* and cleaning up the directory.
|
|
908
|
+
*
|
|
909
|
+
* The `encoding` option sets the encoding for the `path` while opening the
|
|
910
|
+
* directory and subsequent read operations.
|
|
911
|
+
*
|
|
912
|
+
* Example using async iteration:
|
|
913
|
+
*
|
|
914
|
+
* ```js
|
|
915
|
+
* import { opendir } from 'fs/promises';
|
|
916
|
+
*
|
|
917
|
+
* try {
|
|
918
|
+
* const dir = await opendir('./');
|
|
919
|
+
* for await (const dirent of dir)
|
|
920
|
+
* console.log(dirent.name);
|
|
921
|
+
* } catch (err) {
|
|
922
|
+
* console.error(err);
|
|
923
|
+
* }
|
|
924
|
+
* ```
|
|
925
|
+
*
|
|
926
|
+
* When using the async iterator, the `fs.Dir` object will be automatically
|
|
927
|
+
* closed after the iterator exits.
|
|
928
|
+
* @since v12.12.0
|
|
929
|
+
* @return Fulfills with an {fs.Dir}.
|
|
930
|
+
*/
|
|
510
931
|
function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
|
|
511
|
-
|
|
512
932
|
/**
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
933
|
+
* Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
|
|
934
|
+
*
|
|
935
|
+
* ```js
|
|
936
|
+
* const { watch } = require('fs/promises');
|
|
937
|
+
*
|
|
938
|
+
* const ac = new AbortController();
|
|
939
|
+
* const { signal } = ac;
|
|
940
|
+
* setTimeout(() => ac.abort(), 10000);
|
|
941
|
+
*
|
|
942
|
+
* (async () => {
|
|
943
|
+
* try {
|
|
944
|
+
* const watcher = watch(__filename, { signal });
|
|
945
|
+
* for await (const event of watcher)
|
|
946
|
+
* console.log(event);
|
|
947
|
+
* } catch (err) {
|
|
948
|
+
* if (err.name === 'AbortError')
|
|
949
|
+
* return;
|
|
950
|
+
* throw err;
|
|
951
|
+
* }
|
|
952
|
+
* })();
|
|
953
|
+
* ```
|
|
954
|
+
*
|
|
955
|
+
* On most platforms, `'rename'` is emitted whenever a filename appears or
|
|
956
|
+
* disappears in the directory.
|
|
957
|
+
*
|
|
958
|
+
* All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
|
|
959
|
+
* @since v15.9.0
|
|
960
|
+
* @return of objects with the properties:
|
|
519
961
|
*/
|
|
520
|
-
function watch(
|
|
521
|
-
|
|
962
|
+
function watch(
|
|
963
|
+
filename: PathLike,
|
|
964
|
+
options:
|
|
965
|
+
| (WatchOptions & {
|
|
966
|
+
encoding: 'buffer';
|
|
967
|
+
})
|
|
968
|
+
| 'buffer'
|
|
969
|
+
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
522
970
|
/**
|
|
523
971
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
524
972
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -527,11 +975,7 @@ declare module 'fs/promises' {
|
|
|
527
975
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
528
976
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
529
977
|
*/
|
|
530
|
-
function watch(
|
|
531
|
-
filename: PathLike,
|
|
532
|
-
options?: WatchOptions | BufferEncoding
|
|
533
|
-
): AsyncIterable<string>;
|
|
534
|
-
|
|
978
|
+
function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
|
|
535
979
|
/**
|
|
536
980
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
537
981
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -540,9 +984,21 @@ declare module 'fs/promises' {
|
|
|
540
984
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
541
985
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
542
986
|
*/
|
|
543
|
-
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<string
|
|
987
|
+
function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
988
|
+
/**
|
|
989
|
+
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
990
|
+
* including subdirectories and files.
|
|
991
|
+
*
|
|
992
|
+
* When copying a directory to another directory, globs are not supported and
|
|
993
|
+
* behavior is similar to `cp dir1/ dir2/`.
|
|
994
|
+
* @since v16.7.0
|
|
995
|
+
* @experimental
|
|
996
|
+
* @param src source path to copy.
|
|
997
|
+
* @param dest destination path to copy to.
|
|
998
|
+
* @return Fulfills with `undefined` upon success.
|
|
999
|
+
*/
|
|
1000
|
+
function cp(source: string, destination: string, opts?: CopyOptions): Promise<void>;
|
|
544
1001
|
}
|
|
545
|
-
|
|
546
1002
|
declare module 'node:fs/promises' {
|
|
547
1003
|
export * from 'fs/promises';
|
|
548
1004
|
}
|