is-builtin-module

Check if a string matches the name of a Node.js builtin module

MIT 8 个版本
安装
npm install is-builtin-module
yarn add is-builtin-module
pnpm add is-builtin-module
bun add is-builtin-module
README

is-builtin-module

Check if a string matches the name of a Node.js builtin module

Note that this matches based a static list of modules from the latest Node.js version. If you want to check for a module in the current Node.js, use the core isBuiltin method.

Install

npm install is-builtin-module

Usage

import isBuiltinModule from 'is-builtin-module';

isBuiltinModule('fs');
//=> true

isBuiltinModule('fs/promises');
//=> true

isBuiltinModule('node:fs/promises');
//=> true

isBuiltinModule('unicorn');
//=> false
  • builtin-modules - A static list of the Node.js builtin modules from the latest Node.js version
版本列表
5.0.0 2025-02-27
4.0.0 2024-04-30
3.2.1 2023-01-31
3.2.0 2022-07-31
3.1.0 2021-04-21
3.0.0 2018-09-19
2.0.0 2017-11-15
1.0.0 2015-05-04