Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
is-builtin-module
Advanced tools
Package description
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.
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
The 'builtin-modules' package provides a list of the built-in modules of Node.js. It is similar to 'is-builtin-module' but instead of checking if a module is built-in, it provides the full list of built-in modules. You can use this list to check for built-in modules manually.
The 'resolve' package is a module resolution algorithm for Node.js, similar to the one used by 'require'. It can be used to check if a module is resolvable and, by extension, to infer if it is a built-in module. However, it is more general-purpose and not specifically designed for checking built-in modules.
Readme
Check if a string matches the name of a Node.js builtin module
$ npm install is-builtin-module
const isBuiltinModule = require('is-builtin-module');
isBuiltinModule('fs');
//=> true
isBuiltinModule('fs/promises');
//=> true
isBuiltinModule('node:fs/promises');
//=> true
isBuiltinModule('unicorn');
//=> false
FAQs
Check if a string matches the name of a Node.js builtin module
The npm package is-builtin-module receives a total of 6,325,650 weekly downloads. As such, is-builtin-module popularity was classified as popular.
We found that is-builtin-module demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.