File: Readme.md

package info (click to toggle)
node-builtins 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 448 kB
  • sloc: javascript: 1,038; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 772 bytes parent folder | download
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