File
Blob: src/node/internal/internal_module.ts
| 1 | // Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | // |
| 5 | // Copyright Joyent, Inc. and other Node contributors. |
| 6 | // |
| 7 | // Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | // copy of this software and associated documentation files (the |
| 9 | // "Software"), to deal in the Software without restriction, including |
| 10 | // without limitation the rights to use, copy, modify, merge, publish, |
| 11 | // distribute, sublicense, and/or sell copies of the Software, and to permit |
| 12 | // persons to whom the Software is furnished to do so, subject to the |
| 13 | // following conditions: |
| 14 | // |
| 15 | // The above copyright notice and this permission notice shall be included |
| 16 | // in all copies or substantial portions of the Software. |
| 17 | // |
| 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN |
| 21 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 22 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | // USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | |
| 26 | // Intentionally does not include modules with mandatory 'node:' |
| 27 | // prefix like `node:test`. |
| 28 | // See: See https://nodejs.org/docs/latest/api/modules.html#built-in-modules-with-mandatory-node-prefix |
| 29 | // TODO(later): This list duplicates the list that is in |
| 30 | // workerd/jsg/modules.c++. Later we should source these |
| 31 | // from the same place so we don't have to maintain two lists. |
| 32 | export const builtinModules = [ |
| 33 | '_http_agent', |
| 34 | '_http_client', |
| 35 | '_http_common', |
| 36 | '_http_incoming', |
| 37 | '_http_outgoing', |
| 38 | '_http_server', |
| 39 | '_stream_duplex', |
| 40 | '_stream_passthrough', |
| 41 | '_stream_readable', |
| 42 | '_stream_transform', |
| 43 | '_stream_wrap', |
| 44 | '_stream_writable', |
| 45 | '_tls_common', |
| 46 | '_tls_wrap', |
| 47 | 'assert', |
| 48 | 'assert/strict', |
| 49 | 'async_hooks', |
| 50 | 'buffer', |
| 51 | 'child_process', |
| 52 | 'cluster', |
| 53 | 'console', |
| 54 | 'constants', |
| 55 | 'crypto', |
| 56 | 'dgram', |
| 57 | 'diagnostics_channel', |
| 58 | 'dns', |
| 59 | 'dns/promises', |
| 60 | 'domain', |
| 61 | 'events', |
| 62 | 'fs', |
| 63 | 'fs/promises', |
| 64 | 'http', |
| 65 | 'http2', |
| 66 | 'https', |
| 67 | 'inspector', |
| 68 | 'inspector/promises', |
| 69 | 'module', |
| 70 | 'net', |
| 71 | 'os', |
| 72 | 'path', |
| 73 | 'path/posix', |
| 74 | 'path/win32', |
| 75 | 'perf_hooks', |
| 76 | 'process', |
| 77 | 'punycode', |
| 78 | 'querystring', |
| 79 | 'readline', |
| 80 | 'readline/promises', |
| 81 | 'repl', |
| 82 | 'stream', |
| 83 | 'stream/consumers', |
| 84 | 'stream/promises', |
| 85 | 'stream/web', |
| 86 | 'string_decoder', |
| 87 | 'sys', |
| 88 | 'timers', |
| 89 | 'timers/promises', |
| 90 | 'tls', |
| 91 | 'trace_events', |
| 92 | 'tty', |
| 93 | 'url', |
| 94 | 'util', |
| 95 | 'util/types', |
| 96 | 'v8', |
| 97 | 'vm', |
| 98 | 'wasi', |
| 99 | 'worker_threads', |
| 100 | 'zlib', |
| 101 | ]; |
| 102 | Object.freeze(builtinModules); |