Socket
Socket
Sign inDemoInstall

builtins

Package Overview
Dependencies
3
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 4.0.0

19

index.js

@@ -5,5 +5,6 @@ 'use strict'

module.exports = function (version) {
version = version || process.version
module.exports = function ({
version = process.version,
experimental = false
} = {}) {
var coreModules = [

@@ -47,7 +48,19 @@ 'assert',

if (semver.gte(version, '1.1.0')) coreModules.push('process')
if (semver.gte(version, '8.0.0')) coreModules.push('inspector')
if (semver.gte(version, '8.1.0')) coreModules.push('async_hooks')
if (semver.gte(version, '8.4.0')) coreModules.push('http2')
if (semver.gte(version, '8.5.0')) coreModules.push('perf_hooks')
if (semver.gte(version, '10.0.0')) coreModules.push('trace_events')
if (
semver.gte(version, '10.5.0') &&
(experimental || semver.gte(version, '12.0.0'))
) {
coreModules.push('worker_threads')
}
if (semver.gte(version, '12.16.0') && experimental) {
coreModules.push('wasi')
}
return coreModules
}

2

package.json
{
"name": "builtins",
"version": "3.0.1",
"version": "4.0.0",
"description": "List of node.js builtin modules",

@@ -5,0 +5,0 @@ "repository": "juliangruber/builtins",

@@ -21,3 +21,3 @@

```js
var builtins = require('builtins')('6.0.0')
var builtins = require('builtins')({ version: '6.0.0' })

@@ -27,4 +27,12 @@ assert(builtins.indexOf('http') > -1)

Add experimental modules to the list:
```js
var builtins = require('builtins')({ experimental: true })
assert(builtins.indexOf('wasi') > -1)
```
## License
MIT
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