daiki-fca 0.0.1
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.
Potentially problematic release.
This version of daiki-fca might be problematic. Click here for more details.
- package/.cache/nix/binary-cache-v6.sqlite +0 -0
- package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
- package/.cache/replit/env/latest +121 -0
- package/.cache/replit/env/latest.json +1 -0
- package/.cache/replit/modules/nix.res +1 -0
- package/.cache/replit/modules/nodejs-20.res +1 -0
- package/.cache/replit/modules/replit.res +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.cache/typescript/5.6/node_modules/.package-lock.json +188 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +318 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +71 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
- package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
- package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
- package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
- package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
- package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +597 -0
- package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
- package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
- package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4343 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +511 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
- package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
- package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
- package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +621 -0
- package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1005 -0
- package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
- package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
- package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
- package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
- package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1996 -0
- package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
- package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
- package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +349 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
- package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
- package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
- package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
- package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2397 -0
- package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
- package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
- package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
- package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
- package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
- package/.cache/typescript/5.6/node_modules/@types/node-cron/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node-cron/README.md +76 -0
- package/.cache/typescript/5.6/node_modules/@types/node-cron/index.d.ts +57 -0
- package/.cache/typescript/5.6/node_modules/@types/node-cron/package.json +50 -0
- package/.cache/typescript/5.6/node_modules/@types/npmlog/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/npmlog/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/npmlog/index.d.ts +84 -0
- package/.cache/typescript/5.6/node_modules/@types/npmlog/package.json +32 -0
- package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
- package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
- package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
- package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
- package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
- package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
- package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
- package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
- package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
- package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
- package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
- package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
- package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
- package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
- package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
- package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
- package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
- package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
- package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
- package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
- package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
- package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
- package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
- package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
- package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
- package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
- package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
- package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
- package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
- package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
- package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
- package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
- package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
- package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
- package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
- package/.cache/typescript/5.6/package-lock.json +202 -0
- package/.cache/typescript/5.6/package.json +1 -0
- package/.replit +8 -0
- package/LICENSE +21 -0
- package/index.js +460 -0
- package/package.json +46 -0
- package/replit.nix +3 -0
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +25 -0
- package/src/addUserToGroup.js +115 -0
- package/src/changeAdminStatus.js +103 -0
- package/src/changeArchivedStatus.js +55 -0
- package/src/changeAvatar.js +136 -0
- package/src/changeAvatarV2.js +86 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +76 -0
- package/src/changeBlockedStatus.js +49 -0
- package/src/changeBlockedStatusMqtt.js +80 -0
- package/src/changeCover.js +72 -0
- package/src/changeGroupImage.js +135 -0
- package/src/changeName.js +79 -0
- package/src/changeNickname.js +59 -0
- package/src/changeThreadColor.js +65 -0
- package/src/changeThreadEmoji.js +55 -0
- package/src/changeUsername.js +59 -0
- package/src/createCommentPost.js +230 -0
- package/src/createNewGroup.js +88 -0
- package/src/createPoll.js +71 -0
- package/src/createPost.js +276 -0
- package/src/deleteMessage.js +56 -0
- package/src/deleteThread.js +56 -0
- package/src/editMessage.js +68 -0
- package/src/editMessageOld.js +67 -0
- package/src/follow.js +74 -0
- package/src/forwardAttachment.js +60 -0
- package/src/getAccess.js +112 -0
- package/src/getAvatarUser.js +78 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +29 -0
- package/src/getFriendsList.js +83 -0
- package/src/getMessage.js +835 -0
- package/src/getRegion.js +7 -0
- package/src/getThreadHistory.js +680 -0
- package/src/getThreadHistoryDeprecated.js +71 -0
- package/src/getThreadInfo.js +232 -0
- package/src/getThreadInfoDeprecated.js +56 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +119 -0
- package/src/getUserID.js +61 -0
- package/src/getUserInfo.js +66 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +47 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/listenMqtt.js +827 -0
- package/src/listenMqtt.txt +827 -0
- package/src/logout.js +75 -0
- package/src/markAsDelivered.js +47 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +40 -0
- package/src/markAsSeen.js +48 -0
- package/src/muteThread.js +45 -0
- package/src/postFormData.txt +46 -0
- package/src/refreshFb_dtsg.js +89 -0
- package/src/removeUserFromGroup.js +79 -0
- package/src/resolvePhotoUrl.js +45 -0
- package/src/searchForThread.js +53 -0
- package/src/searchStickers.js +53 -0
- package/src/sendMessage.js +329 -0
- package/src/sendMessageMqtt.js +322 -0
- package/src/sendTypingIndicator.js +101 -0
- package/src/sendTypingIndicatorV2.js +28 -0
- package/src/setMessageReaction.js +122 -0
- package/src/setMessageReactionMqtt.js +62 -0
- package/src/setPostReaction.js +112 -0
- package/src/setStoryReaction.js +64 -0
- package/src/setTitle.js +90 -0
- package/src/shareContact.js +110 -0
- package/src/shareLink.js +59 -0
- package/src/stopListenMqtt.js +23 -0
- package/src/threadColors.js +131 -0
- package/src/unfriend.js +52 -0
- package/src/unsendMessage.js +45 -0
- package/src/uploadAttachment.js +94 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +2876 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since v0.3.7
|
|
3
|
+
*/
|
|
4
|
+
declare module "module" {
|
|
5
|
+
import { URL } from "node:url";
|
|
6
|
+
class Module {
|
|
7
|
+
constructor(id: string, parent?: Module);
|
|
8
|
+
}
|
|
9
|
+
interface Module extends NodeJS.Module {}
|
|
10
|
+
namespace Module {
|
|
11
|
+
export { Module };
|
|
12
|
+
}
|
|
13
|
+
namespace Module {
|
|
14
|
+
/**
|
|
15
|
+
* A list of the names of all modules provided by Node.js. Can be used to verify
|
|
16
|
+
* if a module is maintained by a third party or not.
|
|
17
|
+
*
|
|
18
|
+
* Note: the list doesn't contain prefix-only modules like `node:test`.
|
|
19
|
+
* @since v9.3.0, v8.10.0, v6.13.0
|
|
20
|
+
*/
|
|
21
|
+
const builtinModules: readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* @since v12.2.0
|
|
24
|
+
* @param path Filename to be used to construct the require
|
|
25
|
+
* function. Must be a file URL object, file URL string, or absolute path
|
|
26
|
+
* string.
|
|
27
|
+
*/
|
|
28
|
+
function createRequire(path: string | URL): NodeJS.Require;
|
|
29
|
+
namespace constants {
|
|
30
|
+
/**
|
|
31
|
+
* The following constants are returned as the `status` field in the object returned by
|
|
32
|
+
* {@link enableCompileCache} to indicate the result of the attempt to enable the
|
|
33
|
+
* [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache).
|
|
34
|
+
* @since v22.8.0
|
|
35
|
+
*/
|
|
36
|
+
namespace compileCacheStatus {
|
|
37
|
+
/**
|
|
38
|
+
* Node.js has enabled the compile cache successfully. The directory used to store the
|
|
39
|
+
* compile cache will be returned in the `directory` field in the
|
|
40
|
+
* returned object.
|
|
41
|
+
*/
|
|
42
|
+
const ENABLED: number;
|
|
43
|
+
/**
|
|
44
|
+
* The compile cache has already been enabled before, either by a previous call to
|
|
45
|
+
* {@link enableCompileCache}, or by the `NODE_COMPILE_CACHE=dir`
|
|
46
|
+
* environment variable. The directory used to store the
|
|
47
|
+
* compile cache will be returned in the `directory` field in the
|
|
48
|
+
* returned object.
|
|
49
|
+
*/
|
|
50
|
+
const ALREADY_ENABLED: number;
|
|
51
|
+
/**
|
|
52
|
+
* Node.js fails to enable the compile cache. This can be caused by the lack of
|
|
53
|
+
* permission to use the specified directory, or various kinds of file system errors.
|
|
54
|
+
* The detail of the failure will be returned in the `message` field in the
|
|
55
|
+
* returned object.
|
|
56
|
+
*/
|
|
57
|
+
const FAILED: number;
|
|
58
|
+
/**
|
|
59
|
+
* Node.js cannot enable the compile cache because the environment variable
|
|
60
|
+
* `NODE_DISABLE_COMPILE_CACHE=1` has been set.
|
|
61
|
+
*/
|
|
62
|
+
const DISABLED: number;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
interface EnableCompileCacheResult {
|
|
66
|
+
/**
|
|
67
|
+
* One of the {@link constants.compileCacheStatus}
|
|
68
|
+
*/
|
|
69
|
+
status: number;
|
|
70
|
+
/**
|
|
71
|
+
* If Node.js cannot enable the compile cache, this contains
|
|
72
|
+
* the error message. Only set if `status` is `module.constants.compileCacheStatus.FAILED`.
|
|
73
|
+
*/
|
|
74
|
+
message?: string;
|
|
75
|
+
/**
|
|
76
|
+
* If the compile cache is enabled, this contains the directory
|
|
77
|
+
* where the compile cache is stored. Only set if `status` is
|
|
78
|
+
* `module.constants.compileCacheStatus.ENABLED` or
|
|
79
|
+
* `module.constants.compileCacheStatus.ALREADY_ENABLED`.
|
|
80
|
+
*/
|
|
81
|
+
directory?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Enable [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
|
|
85
|
+
* in the current Node.js instance.
|
|
86
|
+
*
|
|
87
|
+
* If `cacheDir` is not specified, Node.js will either use the directory specified by the
|
|
88
|
+
* `NODE_COMPILE_CACHE=dir` environment variable if it's set, or use
|
|
89
|
+
* `path.join(os.tmpdir(), 'node-compile-cache')` otherwise. For general use cases, it's
|
|
90
|
+
* recommended to call `module.enableCompileCache()` without specifying the `cacheDir`,
|
|
91
|
+
* so that the directory can be overridden by the `NODE_COMPILE_CACHE` environment
|
|
92
|
+
* variable when necessary.
|
|
93
|
+
*
|
|
94
|
+
* Since compile cache is supposed to be a quiet optimization that is not required for the
|
|
95
|
+
* application to be functional, this method is designed to not throw any exception when the
|
|
96
|
+
* compile cache cannot be enabled. Instead, it will return an object containing an error
|
|
97
|
+
* message in the `message` field to aid debugging.
|
|
98
|
+
* If compile cache is enabled successfully, the `directory` field in the returned object
|
|
99
|
+
* contains the path to the directory where the compile cache is stored. The `status`
|
|
100
|
+
* field in the returned object would be one of the `module.constants.compileCacheStatus`
|
|
101
|
+
* values to indicate the result of the attempt to enable the
|
|
102
|
+
* [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache).
|
|
103
|
+
*
|
|
104
|
+
* This method only affects the current Node.js instance. To enable it in child worker threads,
|
|
105
|
+
* either call this method in child worker threads too, or set the
|
|
106
|
+
* `process.env.NODE_COMPILE_CACHE` value to compile cache directory so the behavior can
|
|
107
|
+
* be inherited into the child workers. The directory can be obtained either from the
|
|
108
|
+
* `directory` field returned by this method, or with {@link getCompileCacheDir}.
|
|
109
|
+
* @since v22.8.0
|
|
110
|
+
* @param cacheDir Optional path to specify the directory where the compile cache
|
|
111
|
+
* will be stored/retrieved.
|
|
112
|
+
*/
|
|
113
|
+
function enableCompileCache(cacheDir?: string): EnableCompileCacheResult;
|
|
114
|
+
/**
|
|
115
|
+
* Flush the [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
|
|
116
|
+
* accumulated from modules already loaded
|
|
117
|
+
* in the current Node.js instance to disk. This returns after all the flushing
|
|
118
|
+
* file system operations come to an end, no matter they succeed or not. If there
|
|
119
|
+
* are any errors, this will fail silently, since compile cache misses should not
|
|
120
|
+
* interfere with the actual operation of the application.
|
|
121
|
+
* @since v22.10.0
|
|
122
|
+
*/
|
|
123
|
+
function flushCompileCache(): void;
|
|
124
|
+
/**
|
|
125
|
+
* @since v22.8.0
|
|
126
|
+
* @return Path to the [module compile cache](https://nodejs.org/docs/latest-v22.x/api/module.html#module-compile-cache)
|
|
127
|
+
* directory if it is enabled, or `undefined` otherwise.
|
|
128
|
+
*/
|
|
129
|
+
function getCompileCacheDir(): string | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* @since v18.6.0, v16.17.0
|
|
132
|
+
*/
|
|
133
|
+
function isBuiltin(moduleName: string): boolean;
|
|
134
|
+
interface RegisterOptions<Data> {
|
|
135
|
+
/**
|
|
136
|
+
* If you want to resolve `specifier` relative to a
|
|
137
|
+
* base URL, such as `import.meta.url`, you can pass that URL here. This
|
|
138
|
+
* property is ignored if the `parentURL` is supplied as the second argument.
|
|
139
|
+
* @default 'data:'
|
|
140
|
+
*/
|
|
141
|
+
parentURL?: string | URL | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Any arbitrary, cloneable JavaScript value to pass into the
|
|
144
|
+
* {@link initialize} hook.
|
|
145
|
+
*/
|
|
146
|
+
data?: Data | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* [Transferable objects](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#portpostmessagevalue-transferlist)
|
|
149
|
+
* to be passed into the `initialize` hook.
|
|
150
|
+
*/
|
|
151
|
+
transferList?: any[] | undefined;
|
|
152
|
+
}
|
|
153
|
+
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
154
|
+
/**
|
|
155
|
+
* Register a module that exports hooks that customize Node.js module
|
|
156
|
+
* resolution and loading behavior. See
|
|
157
|
+
* [Customization hooks](https://nodejs.org/docs/latest-v22.x/api/module.html#customization-hooks).
|
|
158
|
+
* @since v20.6.0, v18.19.0
|
|
159
|
+
* @param specifier Customization hooks to be registered; this should be
|
|
160
|
+
* the same string that would be passed to `import()`, except that if it is
|
|
161
|
+
* relative, it is resolved relative to `parentURL`.
|
|
162
|
+
* @param parentURL f you want to resolve `specifier` relative to a base
|
|
163
|
+
* URL, such as `import.meta.url`, you can pass that URL here.
|
|
164
|
+
*/
|
|
165
|
+
function register<Data = any>(
|
|
166
|
+
specifier: string | URL,
|
|
167
|
+
parentURL?: string | URL,
|
|
168
|
+
options?: RegisterOptions<Data>,
|
|
169
|
+
): void;
|
|
170
|
+
function register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
|
|
171
|
+
/* eslint-enable @definitelytyped/no-unnecessary-generics */
|
|
172
|
+
/**
|
|
173
|
+
* The `module.syncBuiltinESMExports()` method updates all the live bindings for
|
|
174
|
+
* builtin `ES Modules` to match the properties of the `CommonJS` exports. It
|
|
175
|
+
* does not add or remove exported names from the `ES Modules`.
|
|
176
|
+
*
|
|
177
|
+
* ```js
|
|
178
|
+
* import fs from 'node:fs';
|
|
179
|
+
* import assert from 'node:assert';
|
|
180
|
+
* import { syncBuiltinESMExports } from 'node:module';
|
|
181
|
+
*
|
|
182
|
+
* fs.readFile = newAPI;
|
|
183
|
+
*
|
|
184
|
+
* delete fs.readFileSync;
|
|
185
|
+
*
|
|
186
|
+
* function newAPI() {
|
|
187
|
+
* // ...
|
|
188
|
+
* }
|
|
189
|
+
*
|
|
190
|
+
* fs.newAPI = newAPI;
|
|
191
|
+
*
|
|
192
|
+
* syncBuiltinESMExports();
|
|
193
|
+
*
|
|
194
|
+
* import('node:fs').then((esmFS) => {
|
|
195
|
+
* // It syncs the existing readFile property with the new value
|
|
196
|
+
* assert.strictEqual(esmFS.readFile, newAPI);
|
|
197
|
+
* // readFileSync has been deleted from the required fs
|
|
198
|
+
* assert.strictEqual('readFileSync' in fs, false);
|
|
199
|
+
* // syncBuiltinESMExports() does not remove readFileSync from esmFS
|
|
200
|
+
* assert.strictEqual('readFileSync' in esmFS, true);
|
|
201
|
+
* // syncBuiltinESMExports() does not add names
|
|
202
|
+
* assert.strictEqual(esmFS.newAPI, undefined);
|
|
203
|
+
* });
|
|
204
|
+
* ```
|
|
205
|
+
* @since v12.12.0
|
|
206
|
+
*/
|
|
207
|
+
function syncBuiltinESMExports(): void;
|
|
208
|
+
interface ImportAttributes extends NodeJS.Dict<string> {
|
|
209
|
+
type?: string | undefined;
|
|
210
|
+
}
|
|
211
|
+
type ModuleFormat =
|
|
212
|
+
| "builtin"
|
|
213
|
+
| "commonjs"
|
|
214
|
+
| "commonjs-typescript"
|
|
215
|
+
| "json"
|
|
216
|
+
| "module"
|
|
217
|
+
| "module-typescript"
|
|
218
|
+
| "wasm";
|
|
219
|
+
type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray;
|
|
220
|
+
/**
|
|
221
|
+
* The `initialize` hook provides a way to define a custom function that runs in
|
|
222
|
+
* the hooks thread when the hooks module is initialized. Initialization happens
|
|
223
|
+
* when the hooks module is registered via {@link register}.
|
|
224
|
+
*
|
|
225
|
+
* This hook can receive data from a {@link register} invocation, including
|
|
226
|
+
* ports and other transferable objects. The return value of `initialize` can be a
|
|
227
|
+
* `Promise`, in which case it will be awaited before the main application thread
|
|
228
|
+
* execution resumes.
|
|
229
|
+
*/
|
|
230
|
+
type InitializeHook<Data = any> = (data: Data) => void | Promise<void>;
|
|
231
|
+
interface ResolveHookContext {
|
|
232
|
+
/**
|
|
233
|
+
* Export conditions of the relevant `package.json`
|
|
234
|
+
*/
|
|
235
|
+
conditions: string[];
|
|
236
|
+
/**
|
|
237
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
238
|
+
*/
|
|
239
|
+
importAttributes: ImportAttributes;
|
|
240
|
+
/**
|
|
241
|
+
* The module importing this one, or undefined if this is the Node.js entry point
|
|
242
|
+
*/
|
|
243
|
+
parentURL: string | undefined;
|
|
244
|
+
}
|
|
245
|
+
interface ResolveFnOutput {
|
|
246
|
+
/**
|
|
247
|
+
* A hint to the load hook (it might be ignored)
|
|
248
|
+
*/
|
|
249
|
+
format?: ModuleFormat | null | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* The import attributes to use when caching the module (optional; if excluded the input will be used)
|
|
252
|
+
*/
|
|
253
|
+
importAttributes?: ImportAttributes | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
256
|
+
* @default false
|
|
257
|
+
*/
|
|
258
|
+
shortCircuit?: boolean | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* The absolute URL to which this input resolves
|
|
261
|
+
*/
|
|
262
|
+
url: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The `resolve` hook chain is responsible for telling Node.js where to find and
|
|
266
|
+
* how to cache a given `import` statement or expression, or `require` call. It can
|
|
267
|
+
* optionally return a format (such as `'module'`) as a hint to the `load` hook. If
|
|
268
|
+
* a format is specified, the `load` hook is ultimately responsible for providing
|
|
269
|
+
* the final `format` value (and it is free to ignore the hint provided by
|
|
270
|
+
* `resolve`); if `resolve` provides a `format`, a custom `load` hook is required
|
|
271
|
+
* even if only to pass the value to the Node.js default `load` hook.
|
|
272
|
+
*/
|
|
273
|
+
type ResolveHook = (
|
|
274
|
+
specifier: string,
|
|
275
|
+
context: ResolveHookContext,
|
|
276
|
+
nextResolve: (
|
|
277
|
+
specifier: string,
|
|
278
|
+
context?: Partial<ResolveHookContext>,
|
|
279
|
+
) => ResolveFnOutput | Promise<ResolveFnOutput>,
|
|
280
|
+
) => ResolveFnOutput | Promise<ResolveFnOutput>;
|
|
281
|
+
interface LoadHookContext {
|
|
282
|
+
/**
|
|
283
|
+
* Export conditions of the relevant `package.json`
|
|
284
|
+
*/
|
|
285
|
+
conditions: string[];
|
|
286
|
+
/**
|
|
287
|
+
* The format optionally supplied by the `resolve` hook chain
|
|
288
|
+
*/
|
|
289
|
+
format: ModuleFormat | null | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* An object whose key-value pairs represent the assertions for the module to import
|
|
292
|
+
*/
|
|
293
|
+
importAttributes: ImportAttributes;
|
|
294
|
+
}
|
|
295
|
+
interface LoadFnOutput {
|
|
296
|
+
format: ModuleFormat;
|
|
297
|
+
/**
|
|
298
|
+
* A signal that this hook intends to terminate the chain of `resolve` hooks.
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
shortCircuit?: boolean | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* The source for Node.js to evaluate
|
|
304
|
+
*/
|
|
305
|
+
source?: ModuleSource | undefined;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The `load` hook provides a way to define a custom method of determining how a
|
|
309
|
+
* URL should be interpreted, retrieved, and parsed. It is also in charge of
|
|
310
|
+
* validating the import attributes.
|
|
311
|
+
*/
|
|
312
|
+
type LoadHook = (
|
|
313
|
+
url: string,
|
|
314
|
+
context: LoadHookContext,
|
|
315
|
+
nextLoad: (
|
|
316
|
+
url: string,
|
|
317
|
+
context?: Partial<LoadHookContext>,
|
|
318
|
+
) => LoadFnOutput | Promise<LoadFnOutput>,
|
|
319
|
+
) => LoadFnOutput | Promise<LoadFnOutput>;
|
|
320
|
+
/**
|
|
321
|
+
* `path` is the resolved path for the file for which a corresponding source map
|
|
322
|
+
* should be fetched.
|
|
323
|
+
* @since v13.7.0, v12.17.0
|
|
324
|
+
* @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
|
|
325
|
+
*/
|
|
326
|
+
function findSourceMap(path: string): SourceMap | undefined;
|
|
327
|
+
interface SourceMapConstructorOptions {
|
|
328
|
+
/**
|
|
329
|
+
* @since v21.0.0, v20.5.0
|
|
330
|
+
*/
|
|
331
|
+
lineLengths?: readonly number[] | undefined;
|
|
332
|
+
}
|
|
333
|
+
interface SourceMapPayload {
|
|
334
|
+
file: string;
|
|
335
|
+
version: number;
|
|
336
|
+
sources: string[];
|
|
337
|
+
sourcesContent: string[];
|
|
338
|
+
names: string[];
|
|
339
|
+
mappings: string;
|
|
340
|
+
sourceRoot: string;
|
|
341
|
+
}
|
|
342
|
+
interface SourceMapping {
|
|
343
|
+
generatedLine: number;
|
|
344
|
+
generatedColumn: number;
|
|
345
|
+
originalSource: string;
|
|
346
|
+
originalLine: number;
|
|
347
|
+
originalColumn: number;
|
|
348
|
+
}
|
|
349
|
+
interface SourceOrigin {
|
|
350
|
+
/**
|
|
351
|
+
* The name of the range in the source map, if one was provided
|
|
352
|
+
*/
|
|
353
|
+
name: string | undefined;
|
|
354
|
+
/**
|
|
355
|
+
* The file name of the original source, as reported in the SourceMap
|
|
356
|
+
*/
|
|
357
|
+
fileName: string;
|
|
358
|
+
/**
|
|
359
|
+
* The 1-indexed lineNumber of the corresponding call site in the original source
|
|
360
|
+
*/
|
|
361
|
+
lineNumber: number;
|
|
362
|
+
/**
|
|
363
|
+
* The 1-indexed columnNumber of the corresponding call site in the original source
|
|
364
|
+
*/
|
|
365
|
+
columnNumber: number;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* @since v13.7.0, v12.17.0
|
|
369
|
+
*/
|
|
370
|
+
class SourceMap {
|
|
371
|
+
constructor(payload: SourceMapPayload, options?: SourceMapConstructorOptions);
|
|
372
|
+
/**
|
|
373
|
+
* Getter for the payload used to construct the `SourceMap` instance.
|
|
374
|
+
*/
|
|
375
|
+
readonly payload: SourceMapPayload;
|
|
376
|
+
/**
|
|
377
|
+
* Given a line offset and column offset in the generated source
|
|
378
|
+
* file, returns an object representing the SourceMap range in the
|
|
379
|
+
* original file if found, or an empty object if not.
|
|
380
|
+
*
|
|
381
|
+
* The object returned contains the following keys:
|
|
382
|
+
*
|
|
383
|
+
* The returned value represents the raw range as it appears in the
|
|
384
|
+
* SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and
|
|
385
|
+
* column numbers as they appear in Error messages and CallSite
|
|
386
|
+
* objects.
|
|
387
|
+
*
|
|
388
|
+
* To get the corresponding 1-indexed line and column numbers from a
|
|
389
|
+
* lineNumber and columnNumber as they are reported by Error stacks
|
|
390
|
+
* and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)`
|
|
391
|
+
* @param lineOffset The zero-indexed line number offset in the generated source
|
|
392
|
+
* @param columnOffset The zero-indexed column number offset in the generated source
|
|
393
|
+
*/
|
|
394
|
+
findEntry(lineOffset: number, columnOffset: number): SourceMapping | {};
|
|
395
|
+
/**
|
|
396
|
+
* Given a 1-indexed `lineNumber` and `columnNumber` from a call site in the generated source,
|
|
397
|
+
* find the corresponding call site location in the original source.
|
|
398
|
+
*
|
|
399
|
+
* If the `lineNumber` and `columnNumber` provided are not found in any source map,
|
|
400
|
+
* then an empty object is returned.
|
|
401
|
+
* @param lineNumber The 1-indexed line number of the call site in the generated source
|
|
402
|
+
* @param columnNumber The 1-indexed column number of the call site in the generated source
|
|
403
|
+
*/
|
|
404
|
+
findOrigin(lineNumber: number, columnNumber: number): SourceOrigin | {};
|
|
405
|
+
}
|
|
406
|
+
function runMain(main?: string): void;
|
|
407
|
+
function wrap(script: string): string;
|
|
408
|
+
}
|
|
409
|
+
global {
|
|
410
|
+
interface ImportMeta {
|
|
411
|
+
/**
|
|
412
|
+
* The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`.
|
|
413
|
+
* **Caveat:** only present on `file:` modules.
|
|
414
|
+
*/
|
|
415
|
+
dirname: string;
|
|
416
|
+
/**
|
|
417
|
+
* The full absolute path and filename of the current module, with symlinks resolved.
|
|
418
|
+
* This is the same as the `url.fileURLToPath()` of the `import.meta.url`.
|
|
419
|
+
* **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it.
|
|
420
|
+
*/
|
|
421
|
+
filename: string;
|
|
422
|
+
/**
|
|
423
|
+
* The absolute `file:` URL of the module.
|
|
424
|
+
*/
|
|
425
|
+
url: string;
|
|
426
|
+
/**
|
|
427
|
+
* Provides a module-relative resolution function scoped to each module, returning
|
|
428
|
+
* the URL string.
|
|
429
|
+
*
|
|
430
|
+
* Second `parent` parameter is only used when the `--experimental-import-meta-resolve`
|
|
431
|
+
* command flag enabled.
|
|
432
|
+
*
|
|
433
|
+
* @since v20.6.0
|
|
434
|
+
*
|
|
435
|
+
* @param specifier The module specifier to resolve relative to `parent`.
|
|
436
|
+
* @param parent The absolute parent module URL to resolve from.
|
|
437
|
+
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
438
|
+
*/
|
|
439
|
+
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
440
|
+
}
|
|
441
|
+
namespace NodeJS {
|
|
442
|
+
interface Module {
|
|
443
|
+
/**
|
|
444
|
+
* The module objects required for the first time by this one.
|
|
445
|
+
* @since v0.1.16
|
|
446
|
+
*/
|
|
447
|
+
children: Module[];
|
|
448
|
+
/**
|
|
449
|
+
* The `module.exports` object is created by the `Module` system. Sometimes this is
|
|
450
|
+
* not acceptable; many want their module to be an instance of some class. To do
|
|
451
|
+
* this, assign the desired export object to `module.exports`.
|
|
452
|
+
* @since v0.1.16
|
|
453
|
+
*/
|
|
454
|
+
exports: any;
|
|
455
|
+
/**
|
|
456
|
+
* The fully resolved filename of the module.
|
|
457
|
+
* @since v0.1.16
|
|
458
|
+
*/
|
|
459
|
+
filename: string;
|
|
460
|
+
/**
|
|
461
|
+
* The identifier for the module. Typically this is the fully resolved
|
|
462
|
+
* filename.
|
|
463
|
+
* @since v0.1.16
|
|
464
|
+
*/
|
|
465
|
+
id: string;
|
|
466
|
+
/**
|
|
467
|
+
* `true` if the module is running during the Node.js preload
|
|
468
|
+
* phase.
|
|
469
|
+
* @since v15.4.0, v14.17.0
|
|
470
|
+
*/
|
|
471
|
+
isPreloading: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Whether or not the module is done loading, or is in the process of
|
|
474
|
+
* loading.
|
|
475
|
+
* @since v0.1.16
|
|
476
|
+
*/
|
|
477
|
+
loaded: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* The module that first required this one, or `null` if the current module is the
|
|
480
|
+
* entry point of the current process, or `undefined` if the module was loaded by
|
|
481
|
+
* something that is not a CommonJS module (e.g. REPL or `import`).
|
|
482
|
+
* @since v0.1.16
|
|
483
|
+
* @deprecated Please use `require.main` and `module.children` instead.
|
|
484
|
+
*/
|
|
485
|
+
parent: Module | null | undefined;
|
|
486
|
+
/**
|
|
487
|
+
* The directory name of the module. This is usually the same as the
|
|
488
|
+
* `path.dirname()` of the `module.id`.
|
|
489
|
+
* @since v11.14.0
|
|
490
|
+
*/
|
|
491
|
+
path: string;
|
|
492
|
+
/**
|
|
493
|
+
* The search paths for the module.
|
|
494
|
+
* @since v0.4.0
|
|
495
|
+
*/
|
|
496
|
+
paths: string[];
|
|
497
|
+
/**
|
|
498
|
+
* The `module.require()` method provides a way to load a module as if
|
|
499
|
+
* `require()` was called from the original module.
|
|
500
|
+
* @since v0.5.1
|
|
501
|
+
*/
|
|
502
|
+
require(id: string): any;
|
|
503
|
+
}
|
|
504
|
+
interface Require {
|
|
505
|
+
/**
|
|
506
|
+
* Used to import modules, `JSON`, and local files.
|
|
507
|
+
* @since v0.1.13
|
|
508
|
+
*/
|
|
509
|
+
(id: string): any;
|
|
510
|
+
/**
|
|
511
|
+
* Modules are cached in this object when they are required. By deleting a key
|
|
512
|
+
* value from this object, the next `require` will reload the module.
|
|
513
|
+
* This does not apply to
|
|
514
|
+
* [native addons](https://nodejs.org/docs/latest-v22.x/api/addons.html),
|
|
515
|
+
* for which reloading will result in an error.
|
|
516
|
+
* @since v0.3.0
|
|
517
|
+
*/
|
|
518
|
+
cache: Dict<Module>;
|
|
519
|
+
/**
|
|
520
|
+
* Instruct `require` on how to handle certain file extensions.
|
|
521
|
+
* @since v0.3.0
|
|
522
|
+
* @deprecated
|
|
523
|
+
*/
|
|
524
|
+
extensions: RequireExtensions;
|
|
525
|
+
/**
|
|
526
|
+
* The `Module` object representing the entry script loaded when the Node.js
|
|
527
|
+
* process launched, or `undefined` if the entry point of the program is not a
|
|
528
|
+
* CommonJS module.
|
|
529
|
+
* @since v0.1.17
|
|
530
|
+
*/
|
|
531
|
+
main: Module | undefined;
|
|
532
|
+
/**
|
|
533
|
+
* @since v0.3.0
|
|
534
|
+
*/
|
|
535
|
+
resolve: RequireResolve;
|
|
536
|
+
}
|
|
537
|
+
/** @deprecated */
|
|
538
|
+
interface RequireExtensions extends Dict<(module: Module, filename: string) => any> {
|
|
539
|
+
".js": (module: Module, filename: string) => any;
|
|
540
|
+
".json": (module: Module, filename: string) => any;
|
|
541
|
+
".node": (module: Module, filename: string) => any;
|
|
542
|
+
}
|
|
543
|
+
interface RequireResolveOptions {
|
|
544
|
+
/**
|
|
545
|
+
* Paths to resolve module location from. If present, these
|
|
546
|
+
* paths are used instead of the default resolution paths, with the exception
|
|
547
|
+
* of
|
|
548
|
+
* [GLOBAL\_FOLDERS](https://nodejs.org/docs/latest-v22.x/api/modules.html#loading-from-the-global-folders)
|
|
549
|
+
* like `$HOME/.node_modules`, which are
|
|
550
|
+
* always included. Each of these paths is used as a starting point for
|
|
551
|
+
* the module resolution algorithm, meaning that the `node_modules` hierarchy
|
|
552
|
+
* is checked from this location.
|
|
553
|
+
* @since v8.9.0
|
|
554
|
+
*/
|
|
555
|
+
paths?: string[] | undefined;
|
|
556
|
+
}
|
|
557
|
+
interface RequireResolve {
|
|
558
|
+
/**
|
|
559
|
+
* Use the internal `require()` machinery to look up the location of a module,
|
|
560
|
+
* but rather than loading the module, just return the resolved filename.
|
|
561
|
+
*
|
|
562
|
+
* If the module can not be found, a `MODULE_NOT_FOUND` error is thrown.
|
|
563
|
+
* @since v0.3.0
|
|
564
|
+
* @param request The module path to resolve.
|
|
565
|
+
*/
|
|
566
|
+
(request: string, options?: RequireResolveOptions): string;
|
|
567
|
+
/**
|
|
568
|
+
* Returns an array containing the paths searched during resolution of `request` or
|
|
569
|
+
* `null` if the `request` string references a core module, for example `http` or
|
|
570
|
+
* `fs`.
|
|
571
|
+
* @since v8.9.0
|
|
572
|
+
* @param request The module path whose lookup paths are being retrieved.
|
|
573
|
+
*/
|
|
574
|
+
paths(request: string): string[] | null;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* The directory name of the current module. This is the same as the
|
|
579
|
+
* `path.dirname()` of the `__filename`.
|
|
580
|
+
* @since v0.1.27
|
|
581
|
+
*/
|
|
582
|
+
var __dirname: string;
|
|
583
|
+
/**
|
|
584
|
+
* The file name of the current module. This is the current module file's absolute
|
|
585
|
+
* path with symlinks resolved.
|
|
586
|
+
*
|
|
587
|
+
* For a main program this is not necessarily the same as the file name used in the
|
|
588
|
+
* command line.
|
|
589
|
+
* @since v0.0.1
|
|
590
|
+
*/
|
|
591
|
+
var __filename: string;
|
|
592
|
+
/**
|
|
593
|
+
* The `exports` variable is available within a module's file-level scope, and is
|
|
594
|
+
* assigned the value of `module.exports` before the module is evaluated.
|
|
595
|
+
* @since v0.1.16
|
|
596
|
+
*/
|
|
597
|
+
var exports: NodeJS.Module["exports"];
|
|
598
|
+
/**
|
|
599
|
+
* A reference to the current module.
|
|
600
|
+
* @since v0.1.16
|
|
601
|
+
*/
|
|
602
|
+
var module: NodeJS.Module;
|
|
603
|
+
/**
|
|
604
|
+
* @since v0.1.13
|
|
605
|
+
*/
|
|
606
|
+
var require: NodeJS.Require;
|
|
607
|
+
// Global-scope aliases for backwards compatibility with @types/node <13.0.x
|
|
608
|
+
// TODO: consider removing in a future major version update
|
|
609
|
+
/** @deprecated Use `NodeJS.Module` instead. */
|
|
610
|
+
interface NodeModule extends NodeJS.Module {}
|
|
611
|
+
/** @deprecated Use `NodeJS.Require` instead. */
|
|
612
|
+
interface NodeRequire extends NodeJS.Require {}
|
|
613
|
+
/** @deprecated Use `NodeJS.RequireResolve` instead. */
|
|
614
|
+
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
615
|
+
}
|
|
616
|
+
export = Module;
|
|
617
|
+
}
|
|
618
|
+
declare module "node:module" {
|
|
619
|
+
import module = require("module");
|
|
620
|
+
export = module;
|
|
621
|
+
}
|