blob: b1c0007d6f5e4a7242b33752be2332e5ab27261c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# builtins
[![CI](https://github.com/juliangruber/builtins/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/builtins/actions/workflows/ci.yml)
List of node.js [builtin modules](http://nodejs.org/api/).
## Usage
```js
const builtins = require('builtins')
```
Get list of core modules for current Node.js version:
```js
assert(builtins().includes('http'))
```
Get list of core modules for specific Node.js version:
```js
assert(builtins({ version: '6.0.0' }).includes('http'))
```
Get list of core modules present in one or mode Node.js versions:
```js
assert(builtins({ version: '*' }).includes('worker_threads'))
```
Add experimental modules to the list:
```js
assert(builtins({ experimental: true }).includes('wasi'))
```
## License
MIT
|