Socket
Socket
Sign inDemoInstall

is-core-module

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-core-module

check if packageName is a core module


Version published
Maintainers
1
Install size
2.94 kB
Created

Package description

What is is-core-module?

The is-core-module package is a simple utility that allows developers to check if a given module name corresponds to a Node.js core module. Core modules are modules that are included with Node.js itself, such as 'http', 'fs', and 'path'. This package is particularly useful when building tools that need to differentiate between core modules and third-party modules.

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

Check if a module is a core module

This feature allows you to check if a string corresponds to a Node.js core module. It returns true if the module is a core module, and false otherwise.

const isCoreModule = require('is-core-module');

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

Check if a module is a core module with a specific Node.js version

This feature allows you to check if a module is a core module in a specific version of Node.js. This is useful when dealing with different Node.js versions that may have different sets of core modules.

const isCoreModule = require('is-core-module');

console.log(isCoreModule('fs', { version: '8.0.0' })); // true
console.log(isCoreModule('http2', { version: '8.0.0' })); // false

Other packages similar to is-core-module

Changelog

Source

v1.0.2 - 2014-09-28

Commits

  • simpler 66fe90f

Readme

Source

is-core-module

NPM

Returns whether or not the packageName you pass in is a core module or not.

Look at the source, you probably just want to use that function. I just can't ever remember it.

Usage

require('is-core-module')('fs') // returns true
require('is-core-module')('butts') // returns false

License

MIT

Keywords

FAQs

Last updated on 29 Sep 2014

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