Socket
Socket
Sign inDemoInstall

is-builtin-module

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-builtin-module

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


Version published
Maintainers
1
Weekly downloads
6,187,956
decreased by-5.44%

Weekly downloads

Package description

What is is-builtin-module?

The is-builtin-module npm package is used to check if a given module name corresponds to a Node.js built-in module. This can be useful when developing tools that need to differentiate between built-in modules and third-party modules, such as bundlers, linters, or dependency analysis tools.

What are is-builtin-module's main functionalities?

Check if a module is a built-in module

This feature allows you to check if a given string corresponds to a Node.js built-in module. In the code sample, 'fs' is recognized as a built-in module, while 'express' is not.

const isBuiltinModule = require('is-builtin-module');

console.log(isBuiltinModule('fs')); // true
console.log(isBuiltinModule('express')); // false

Other packages similar to is-builtin-module

Readme

Source

is-builtin-module

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

Install

$ npm install is-builtin-module

Usage

const isBuiltinModule = require('is-builtin-module');

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

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

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

isBuiltinModule('unicorn');
//=> false
  • builtin-modules - List of the Node.js builtin modules

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 31 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc