Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-builtin-module

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-builtin-module - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

10

index.js

@@ -5,2 +5,3 @@ 'use strict';

const moduleSet = new Set(builtinModules);
const NODE_PROTOCOL = 'node:';

@@ -12,3 +13,12 @@ module.exports = moduleName => {

if (moduleName.startsWith(NODE_PROTOCOL)) {
moduleName = moduleName.slice(NODE_PROTOCOL.length);
}
const slashIndex = moduleName.indexOf('/');
if (slashIndex !== -1) {
moduleName = moduleName.slice(0, slashIndex);
}
return moduleSet.has(moduleName);
};

2

package.json
{
"name": "is-builtin-module",
"version": "3.0.0",
"version": "3.1.0",
"description": "Check if a string matches the name of a Node.js builtin module",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,2 +0,2 @@

# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module)
# is-builtin-module

@@ -21,2 +21,8 @@ > Check if a string matches the name of a Node.js builtin module

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

@@ -32,4 +38,12 @@ //=> false

## License
---
MIT © [Sindre Sorhus](https://sindresorhus.com)
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-is-builtin-module?utm_source=npm-is-builtin-module&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc