mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

Provides list of all builtin modules in Node. Includes modules of all types: - prefixed (ex: _tls_common) - deprecated (ex: sys) - regular (ex: vm) PR-URL: https://github.com/nodejs/node/pull/16386 Refs: https://github.com/nodejs/node/issues/3307 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
15 lines
382 B
JavaScript
15 lines
382 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { builtinModules } = require('module');
|
|
|
|
// Includes modules in lib/ (even deprecated ones)
|
|
assert(builtinModules.includes('http'));
|
|
assert(builtinModules.includes('sys'));
|
|
|
|
// Does not include internal modules
|
|
assert.deepStrictEqual(
|
|
builtinModules.filter((mod) => mod.startsWith('internal/')),
|
|
[]
|
|
);
|