is-builtin-module
- Version 4.0.0
- Published
- 3.94 kB
- 1 dependency
- MIT license
Install
npm i is-builtin-module
yarn add is-builtin-module
pnpm add is-builtin-module
Overview
Check if a string matches the name of a Node.js builtin module
Index
Functions
Functions
function isBuiltinModule
isBuiltinModule: (moduleName: string) => boolean;
Check if a string matches the name of a Node.js builtin module.
This matches based a [static list of modules](https://github.com/sindresorhus/builtin-modules) from the latest Node.js version. If you want to check for a module in the current Node.js, use the core [
isBuiltin
](https://nodejs.org/api/module.html#moduleisbuiltinmodulename) method.Parameter moduleName
The name of the module.
Example 1
import isBuiltinModule from 'is-builtin-module';isBuiltinModule('fs/promises');//=> trueisBuiltinModule('node:fs');//=> trueisBuiltinModule('unicorn');//=> false
Package Files (1)
Dependencies (1)
Dev Dependencies (3)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/is-builtin-module
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/is-builtin-module)
- HTML<a href="https://www.jsdocs.io/package/is-builtin-module"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3029 ms. - Missing or incorrect documentation? Open an issue for this package.