is-builtin 3.0.0
Install from the command line:
Learn more about npm packages
$ npm install @flex-development/is-builtin@3.0.0
Install via package.json:
"@flex-development/is-builtin": "3.0.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.
yarn add @flex-development/is-builtin
From Git:
yarn add @flex-development/is-builtin@flex-development/is-builtin
See Git - Protocols | Yarn for details on requesting a specific branch, commit, or tag.
import { isBuiltin } from '@flex-development/is-builtin'
import { URL, pathToFileURL } from 'node:url'
console.debug(isBuiltin('@flex-development/is-builtin')) // false
console.debug(isBuiltin('fs/promises')) // true
console.debug(isBuiltin('node:module')) // true
console.debug(isBuiltin(new URL('node:os'))) // true
console.debug(isBuiltin(pathToFileURL('node_modules/@flex-development/mlly'))) // false
This package exports the following identifiers:
There is no default export.
Checks if the given module id
is a builtin module.
Supports bare specifiers and node:
URLs. If the given module id
is an instance of URL
,
id.href
will be checked instead.
-
id
(URL | string
) — Module id to evaluate
Returns true
if id
is a builtin module, false
otherwise.
This package is fully typed with TypeScript.
-
builtin-modules
— Universal drop-in replacement formodule.builtinModules
See CONTRIBUTING.md
.
Details
- is-builtin
- flex-development
- over 1 year ago
- BSD-3-Clause
- 81 dependencies
Assets
- is-builtin-3.0.0.tgz
Download activity
- Total downloads 56
- Last 30 days 0
- Last week 0
- Today 0