is-builtin 3.2.0
Install from the command line:
Learn more about npm packages
$ npm install @flex-development/is-builtin@3.2.0
Install via package.json:
"@flex-development/is-builtin": "3.2.0"
About this version
Universal drop-in replacement for module.isBuiltin
This package is a universal drop-in replacement for module.isBuiltin
.
This package exports a single function that can be used to determine if a module is a builtin module. Builtin
modules are core modules maintained by Node.js. They can be imported by name or using a node:
URL.
This package is ESM only.
In Node.js (version 18+) with yarn:
yarn add @flex-development/is-builtin
See Git - Protocols | Yarn for details regarding installing from Git.
In Deno with esm.sh
:
import { isBuiltin } from 'https://esm.sh/@flex-development/is-builtin'
In browsers with esm.sh
:
<script type="module">
import { isBuiltin } from 'https://esm.sh/@flex-development/is-builtin'
</script>
import { isBuiltin } from '@flex-development/is-builtin'
isBuiltin('@flex-development/is-builtin') // false
isBuiltin('assert') // true
isBuiltin('fs/promises') // true
isBuiltin(new URL('node:os')) // true
isBuiltin('node:module') // true
isBuiltin('node:test/reporters') // true
isBuiltin('test') // false
isBuiltin(null) // false
This package exports the identifier isBuiltin
.
The default export is also isBuiltin
.
Check if m
references a builtin module.
👉 Note:
m
will be converted to a string (String(m)
) before being checked.
-
m
(unknown
) — the thing to check
true
if m
references builtin module, false
otherwise.
This package is fully typed with TypeScript.
-
builtin-modules
— Universal drop-in replacement formodule.builtinModules
See CONTRIBUTING.md
.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Details
- is-builtin
- flex-development
- 18 days ago
- BSD-3-Clause
- 126 dependencies
Assets
- is-builtin-3.2.0.tgz
Download activity
- Total downloads 4
- Last 30 days 4
- Last week 0
- Today 0