-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provides list of all builtin modules in Node. Includes modules of all types: - prefixed (ex: _tls_common) - deprecated (ex: sys) - regular (ex: vm) Backport-PR-URL: #18221 PR-URL: #16386 Refs: #3307 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
- Loading branch information
1 parent
ea61ecf
commit d9f4b0f
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'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/')), | ||
[] | ||
); |