builtin-modules 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  [
2
2
  "assert",
3
+ "assert/strict",
3
4
  "async_hooks",
4
5
  "buffer",
5
6
  "child_process",
@@ -10,31 +11,42 @@
10
11
  "dgram",
11
12
  "diagnostics_channel",
12
13
  "dns",
14
+ "dns/promises",
13
15
  "domain",
14
16
  "events",
15
17
  "fs",
18
+ "fs/promises",
16
19
  "http",
17
20
  "http2",
18
21
  "https",
19
22
  "inspector",
23
+ "inspector/promises",
20
24
  "module",
21
25
  "net",
22
26
  "os",
23
27
  "path",
28
+ "path/posix",
29
+ "path/win32",
24
30
  "perf_hooks",
25
31
  "process",
26
32
  "punycode",
27
33
  "querystring",
28
34
  "readline",
35
+ "readline/promises",
29
36
  "repl",
30
37
  "stream",
38
+ "stream/consumers",
39
+ "stream/promises",
40
+ "stream/web",
31
41
  "string_decoder",
32
42
  "timers",
43
+ "timers/promises",
33
44
  "tls",
34
45
  "trace_events",
35
46
  "tty",
36
47
  "url",
37
48
  "util",
49
+ "util/types",
38
50
  "v8",
39
51
  "vm",
40
52
  "wasi",
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- List of the Node.js builtin modules.
2
+ A static list of the Node.js builtin modules from the latest Node.js version.
3
3
 
4
4
  @example
5
5
  ```
6
- import builtinModules = require('builtin-modules');
6
+ import builtinModules from 'builtin-modules';
7
7
 
8
8
  console.log(builtinModules);
9
9
  //=> ['assert', 'buffer', …]
@@ -11,4 +11,4 @@ console.log(builtinModules);
11
11
  */
12
12
  declare const builtinModules: readonly string[];
13
13
 
14
- export = builtinModules;
14
+ export default builtinModules;
package/index.js CHANGED
@@ -1,11 +1,3 @@
1
- 'use strict';
2
- const {builtinModules} = require('module');
1
+ import builtinModules from './builtin-modules.json' with {type: 'json'};
3
2
 
4
- const ignoreList = [
5
- 'sys'
6
- ];
7
-
8
- // eslint-disable-next-line node/no-deprecated-api
9
- module.exports = (builtinModules || (process.binding ? Object.keys(process.binding('natives')) : []) || [])
10
- .filter(x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x))
11
- .sort();
3
+ export default builtinModules;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builtin-modules",
3
- "version": "3.3.0",
4
- "description": "List of the Node.js builtin modules",
3
+ "version": "4.0.0",
4
+ "description": "A static list of the Node.js builtin modules from the latest Node.js version",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/builtin-modules",
7
7
  "funding": "https://github.com/sponsors/sindresorhus",
@@ -10,18 +10,23 @@
10
10
  "email": "sindresorhus@gmail.com",
11
11
  "url": "https://sindresorhus.com"
12
12
  },
13
+ "type": "module",
14
+ "exports": {
15
+ "types": "./index.d.ts",
16
+ "default": "./index.js"
17
+ },
18
+ "sideEffects": false,
13
19
  "engines": {
14
- "node": ">=6"
20
+ "node": ">=18.20"
15
21
  },
16
22
  "scripts": {
17
- "test": "xo && ava && tsd",
23
+ "//test": "xo && ava && tsd",
24
+ "test": "ava && tsd",
18
25
  "make": "node make.js"
19
26
  },
20
27
  "files": [
21
28
  "index.js",
22
29
  "index.d.ts",
23
- "static.js",
24
- "static.d.ts",
25
30
  "builtin-modules.json"
26
31
  ],
27
32
  "keywords": [
@@ -37,8 +42,8 @@
37
42
  "names"
38
43
  ],
39
44
  "devDependencies": {
40
- "ava": "^1.4.1",
41
- "tsd": "^0.7.2",
42
- "xo": "^0.24.0"
45
+ "ava": "^6.1.2",
46
+ "tsd": "^0.31.0",
47
+ "xo": "^0.58.0"
43
48
  }
44
49
  }
package/readme.md CHANGED
@@ -1,44 +1,32 @@
1
1
  # builtin-modules
2
2
 
3
- > List of the Node.js builtin modules
3
+ > A static list of the Node.js builtin modules from the latest Node.js version
4
4
 
5
5
  The list is just a [JSON file](builtin-modules.json) and can be used anywhere.
6
6
 
7
7
  ## Install
8
8
 
9
- ```
10
- $ npm install builtin-modules
9
+ ```sh
10
+ npm install builtin-modules
11
11
  ```
12
12
 
13
13
  ## Usage
14
14
 
15
15
  ```js
16
- const builtinModules = require('builtin-modules');
16
+ import builtinModules from 'builtin-modules';
17
17
 
18
18
  console.log(builtinModules);
19
- //=> ['assert', 'buffer', ...]
19
+ //=> ['assert', 'buffer', ]
20
20
  ```
21
21
 
22
- ## API
23
-
24
- Returns an array of builtin modules fetched from the running Node.js version.
22
+ ## Tip
25
23
 
26
- ### Static list
24
+ To get a list from the current Node.js version, use the built-in API:
27
25
 
28
- This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');`
26
+ ```js
27
+ import {builtinModules} from 'node:module';
28
+ ```
29
29
 
30
30
  ## Related
31
31
 
32
32
  - [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module
33
-
34
- ---
35
-
36
- <div align="center">
37
- <b>
38
- <a href="https://tidelift.com/subscription/pkg/npm-builtin-modules?utm_source=npm-builtin-modules&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
39
- </b>
40
- <br>
41
- <sub>
42
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
43
- </sub>
44
- </div>
package/static.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- Static list of the Node.js builtin modules.
3
-
4
- @example
5
- ```
6
- import builtinModulesStatic = require('builtin-modules/static');
7
-
8
- console.log(builtinModulesStatic);
9
- //=> ['assert', 'buffer', …]
10
- ```
11
- */
12
- declare const builtinModulesStatic: readonly string[];
13
-
14
- export = builtinModulesStatic;
package/static.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = require('./builtin-modules');