builtin-modules 1.1.1 → 3.2.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
+ "async_hooks",
3
4
  "buffer",
4
5
  "child_process",
5
6
  "cluster",
@@ -12,11 +13,14 @@
12
13
  "events",
13
14
  "fs",
14
15
  "http",
16
+ "http2",
15
17
  "https",
18
+ "inspector",
16
19
  "module",
17
20
  "net",
18
21
  "os",
19
22
  "path",
23
+ "perf_hooks",
20
24
  "process",
21
25
  "punycode",
22
26
  "querystring",
@@ -26,10 +30,13 @@
26
30
  "string_decoder",
27
31
  "timers",
28
32
  "tls",
33
+ "trace_events",
29
34
  "tty",
30
35
  "url",
31
36
  "util",
32
37
  "v8",
33
38
  "vm",
39
+ "wasi",
40
+ "worker_threads",
34
41
  "zlib"
35
42
  ]
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ List of the Node.js builtin modules.
3
+
4
+ @example
5
+ ```
6
+ import builtinModules = require('builtin-modules');
7
+
8
+ console.log(builtinModules);
9
+ //=> ['assert', 'buffer', …]
10
+ ```
11
+ */
12
+ declare const builtinModules: readonly string[];
13
+
14
+ export = builtinModules;
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
+ const {builtinModules} = require('module');
2
3
 
3
- var blacklist = [
4
- 'freelist',
4
+ const ignoreList = [
5
5
  'sys'
6
6
  ];
7
7
 
8
- module.exports = Object.keys(process.binding('natives')).filter(function (el) {
9
- return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1;
10
- }).sort();
8
+ // eslint-disable-next-line node/no-deprecated-api
9
+ module.exports = (builtinModules || Object.keys(process.binding('natives')))
10
+ .filter(x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x))
11
+ .sort();
package/license CHANGED
@@ -1,21 +1,9 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
6
 
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
8
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,40 +1,44 @@
1
1
  {
2
- "name": "builtin-modules",
3
- "version": "1.1.1",
4
- "description": "List of the Node.js builtin modules",
5
- "license": "MIT",
6
- "repository": "sindresorhus/builtin-modules",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=0.10.0"
14
- },
15
- "scripts": {
16
- "test": "xo && ava",
17
- "make": "node make.js"
18
- },
19
- "files": [
20
- "index.js",
21
- "static.js",
22
- "builtin-modules.json"
23
- ],
24
- "keywords": [
25
- "builtin",
26
- "built-in",
27
- "builtins",
28
- "node",
29
- "modules",
30
- "core",
31
- "bundled",
32
- "list",
33
- "array",
34
- "names"
35
- ],
36
- "devDependencies": {
37
- "ava": "*",
38
- "xo": "*"
39
- }
2
+ "name": "builtin-modules",
3
+ "version": "3.2.0",
4
+ "description": "List of the Node.js builtin modules",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/builtin-modules",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "author": {
9
+ "name": "Sindre Sorhus",
10
+ "email": "sindresorhus@gmail.com",
11
+ "url": "https://sindresorhus.com"
12
+ },
13
+ "engines": {
14
+ "node": ">=6"
15
+ },
16
+ "scripts": {
17
+ "test": "xo && ava && tsd",
18
+ "make": "node make.js"
19
+ },
20
+ "files": [
21
+ "index.js",
22
+ "index.d.ts",
23
+ "static.js",
24
+ "static.d.ts",
25
+ "builtin-modules.json"
26
+ ],
27
+ "keywords": [
28
+ "builtin",
29
+ "built-in",
30
+ "builtins",
31
+ "node",
32
+ "modules",
33
+ "core",
34
+ "bundled",
35
+ "list",
36
+ "array",
37
+ "names"
38
+ ],
39
+ "devDependencies": {
40
+ "ava": "^1.4.1",
41
+ "tsd": "^0.7.2",
42
+ "xo": "^0.24.0"
43
+ }
40
44
  }
package/readme.md CHANGED
@@ -1,27 +1,24 @@
1
- # builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules)
1
+ # builtin-modules
2
2
 
3
3
  > List of the Node.js builtin modules
4
4
 
5
- The list is just a [JSON file](builtin-modules.json) and can be used wherever.
6
-
5
+ The list is just a [JSON file](builtin-modules.json) and can be used anywhere.
7
6
 
8
7
  ## Install
9
8
 
10
9
  ```
11
- $ npm install --save builtin-modules
10
+ $ npm install builtin-modules
12
11
  ```
13
12
 
14
-
15
13
  ## Usage
16
14
 
17
15
  ```js
18
- var builtinModules = require('builtin-modules');
16
+ const builtinModules = require('builtin-modules');
19
17
 
20
- console.log(builinModules);
18
+ console.log(builtinModules);
21
19
  //=> ['assert', 'buffer', ...]
22
20
  ```
23
21
 
24
-
25
22
  ## API
26
23
 
27
24
  Returns an array of builtin modules fetched from the running Node.js version.
@@ -30,12 +27,18 @@ Returns an array of builtin modules fetched from the running Node.js version.
30
27
 
31
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');`
32
29
 
33
-
34
30
  ## Related
35
31
 
36
32
  - [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module
37
33
 
38
-
39
- ## License
40
-
41
- MIT © [Sindre Sorhus](http://sindresorhus.com)
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 ADDED
@@ -0,0 +1,14 @@
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 CHANGED
@@ -1,2 +1,2 @@
1
1
  'use strict';
2
- module.exports = require('./builtin-modules.json');
2
+ module.exports = require('./builtin-modules');