is-builtin-module
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

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

Related

  • builtin-modules - A static list of the Node.js builtin modules from the latest Node.js version

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.0.0
    590
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 4.0.0
    590
  • 3.2.1
    5,644,188
  • 3.2.0
    831,602
  • 3.1.0
    1,802,792
  • 3.0.0
    512,398
  • 2.0.0
    85,959
  • 1.0.0
    3,173,156

Package Sidebar

Install

npm i is-builtin-module

Weekly Downloads

6,141,603

Version

4.0.0

License

MIT

Unpacked Size

3.94 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus