diff --git a/lib/index.js b/lib/index.js index e7e612b..fd800d5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,7 @@ 'use strict' +const { builtinModules: builtins } = require('module') var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') -var builtins = require('builtins') var blacklist = [ 'node_modules', 'favicon.ico', @@ -52,11 +52,9 @@ function validate (name) { // Generate warnings for stuff that used to be allowed // core module names like http, events, util, etc - builtins({ version: '*' }).forEach(function (builtin) { - if (name.toLowerCase() === builtin) { - warnings.push(builtin + ' is a core module name') - } - }) + if (builtins.includes(name.toLowerCase())) { + warnings.push(name + ' is a core module name') + } if (name.length > 214) { warnings.push('name can no longer contain more than 214 characters') diff --git a/package.json b/package.json index 7851bc3..d3fa29a 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,6 @@ "directories": { "test": "test" }, - "dependencies": { - "builtins": "^5.0.0" - }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.21.3",