@putout/plugin-nodejs 14.1.0 → 15.0.1

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.
Files changed (52) hide show
  1. package/lib/add-node-prefix/index.js +5 -7
  2. package/lib/cjs-file/index.js +13 -6
  3. package/lib/convert-buffer-to-buffer-alloc/index.js +4 -5
  4. package/lib/convert-commonjs-to-esm-commons/index.js +5 -7
  5. package/lib/convert-commonjs-to-esm-exports/index.js +11 -12
  6. package/lib/convert-commonjs-to-esm-require/index.js +18 -21
  7. package/lib/convert-commonjs-to-esm.js +4 -6
  8. package/lib/convert-dirname-to-url/index.js +4 -5
  9. package/lib/convert-esm-to-commonjs/index.js +3 -4
  10. package/lib/convert-exports-to-module-exports/index.js +2 -4
  11. package/lib/convert-fs-promises/index.js +2 -4
  12. package/lib/convert-promisify-to-fs-promises/index.js +7 -6
  13. package/lib/convert-top-level-return/index.js +4 -5
  14. package/lib/convert-url-to-dirname/index.js +4 -5
  15. package/lib/declare/index.js +25 -14
  16. package/lib/declare/modules/child_process.js +9 -0
  17. package/lib/declare/modules/events.js +12 -0
  18. package/lib/declare/modules/fs-promises.js +31 -0
  19. package/lib/declare/modules/fs.js +100 -0
  20. package/lib/declare/modules/module.js +10 -0
  21. package/lib/declare/modules/os.js +21 -0
  22. package/lib/declare/modules/path.js +16 -0
  23. package/lib/declare/modules/process.js +55 -0
  24. package/lib/declare/modules/stream.js +14 -0
  25. package/lib/declare/modules/url.js +7 -0
  26. package/lib/declare/modules/util.js +14 -0
  27. package/lib/declare/modules/zlib.js +40 -0
  28. package/lib/declare-after-require/index.js +4 -5
  29. package/lib/group-require-by-id/index.js +5 -6
  30. package/lib/index.js +23 -30
  31. package/lib/mjs-file/index.js +13 -6
  32. package/lib/remove-process-exit/index.js +2 -4
  33. package/lib/remove-useless-promisify/index.js +2 -4
  34. package/lib/rename-file-cjs-to-js/index.js +12 -3
  35. package/lib/rename-file-mjs-to-js/index.js +12 -4
  36. package/lib/strict-mode/add-missing/index.js +8 -8
  37. package/lib/strict-mode/index.js +4 -6
  38. package/lib/strict-mode/remove-illegal/index.js +4 -5
  39. package/lib/strict-mode/remove-useless/index.js +4 -5
  40. package/package.json +8 -8
  41. package/lib/declare/modules/child_process.json +0 -9
  42. package/lib/declare/modules/events.json +0 -12
  43. package/lib/declare/modules/fs-promises.json +0 -31
  44. package/lib/declare/modules/fs.json +0 -100
  45. package/lib/declare/modules/module.json +0 -10
  46. package/lib/declare/modules/os.json +0 -21
  47. package/lib/declare/modules/path.json +0 -16
  48. package/lib/declare/modules/process.json +0 -55
  49. package/lib/declare/modules/stream.json +0 -14
  50. package/lib/declare/modules/url.json +0 -7
  51. package/lib/declare/modules/util.json +0 -14
  52. package/lib/declare/modules/zlib.json +0 -40
@@ -1,100 +0,0 @@
1
- {
2
- "appendFile": "import {appendFile} from 'fs'",
3
- "appendFileSync": "import {appendFileSync} from 'fs'",
4
- "access": "import {access} from 'fs'",
5
- "accessSync": "import {accessSync} from 'fs'",
6
- "chown": "import {chown} from 'fs'",
7
- "chownSync": "import {chownSync} from 'fs'",
8
- "chmod": "import {chmod} from 'fs'",
9
- "chmodSync": "import {chmodSync} from 'fs'",
10
- "close": "import {close} from 'fs'",
11
- "closeSync": "import {closeSync} from 'fs'",
12
- "copyFile": "import {copyFile} from 'fs'",
13
- "copyFileSync": "import {copyFileSync} from 'fs'",
14
- "cp": "import {cp} from 'fs'",
15
- "cpSync": "import {cpSync} from 'fs'",
16
- "createReadStream": "import {createReadStream} from 'fs'",
17
- "createWriteStream": "import {createWriteStream} from 'fs'",
18
- "exists": "import {exists} from 'fs'",
19
- "existsSync": "import {existsSync} from 'fs'",
20
- "fchown": "import {fchown} from 'fs'",
21
- "fchownSync": "import {fchownSync} from 'fs'",
22
- "fchmod": "import {fchmod} from 'fs'",
23
- "fchmodSync": "import {fchmodSync} from 'fs'",
24
- "fdatasync": "import {fdatasync} from 'fs'",
25
- "fdatasyncSync": "import {fdatasyncSync} from 'fs'",
26
- "fstat": "import {fstat} from 'fs'",
27
- "fstatSync": "import {fstatSync} from 'fs'",
28
- "fsync": "import {fsync} from 'fs'",
29
- "fsyncSync": "import {fsyncSync} from 'fs'",
30
- "ftruncate": "import {ftruncate} from 'fs'",
31
- "ftruncateSync": "import {ftruncateSync} from 'fs'",
32
- "futimes": "import {futimes} from 'fs'",
33
- "futimesSync": "import {futimesSync} from 'fs'",
34
- "lchown": "import {lchown} from 'fs'",
35
- "lchownSync": "import {lchownSync} from 'fs'",
36
- "lchmod": "import {lchmod} from 'fs'",
37
- "lchmodSync": "import {lchmodSync} from 'fs'",
38
- "link": "import {link} from 'fs'",
39
- "linkSync": "import {linkSync} from 'fs'",
40
- "lstat": "import {lstat} from 'fs'",
41
- "lstatSync": "import {lstatSync} from 'fs'",
42
- "lutimes": "import {lutimes} from 'fs'",
43
- "lutimesSync": "import {lutimesSync} from 'fs'",
44
- "mkdir": "import {mkdir} from 'fs'",
45
- "mkdirSync": "import {mkdirSync} from 'fs'",
46
- "mkdtemp": "import {mkdtemp} from 'fs'",
47
- "mkdtempSync": "import {mkdtempSync} from 'fs'",
48
- "open": "import {open} from 'fs'",
49
- "openSync": "import {openSync} from 'fs'",
50
- "opendir": "import {opendir} from 'fs'",
51
- "opendirSync": "import {opendirSync} from 'fs'",
52
- "readdir": "import {readdir} from 'fs'",
53
- "readdirSync": "import {readdirSync} from 'fs'",
54
- "read": "import {read} from 'fs'",
55
- "readSync": "import {readSync} from 'fs'",
56
- "readv": "import {readv} from 'fs'",
57
- "readvSync": "import {readvSync} from 'fs'",
58
- "readFile": "import {readFile} from 'fs'",
59
- "readFileSync": "import {readFileSync} from 'fs'",
60
- "readlink": "import {readlink} from 'fs'",
61
- "readlinkSync": "import {readlinkSync} from 'fs'",
62
- "realpath": "import {realpath} from 'fs'",
63
- "realpathSync": "import {realpathSync} from 'fs'",
64
- "rename": "import {rename} from 'fs'",
65
- "renameSync": "import {renameSync} from 'fs'",
66
- "rm": "import {rm} from 'fs'",
67
- "rmSync": "import {rmSync} from 'fs'",
68
- "rmdir": "import {rmdir} from 'fs'",
69
- "rmdirSync": "import {rmdirSync} from 'fs'",
70
- "stat": "import {stat} from 'fs'",
71
- "statSync": "import {statSync} from 'fs'",
72
- "symlink": "import {symlink} from 'fs'",
73
- "symlinkSync": "import {symlinkSync} from 'fs'",
74
- "truncate": "import {truncate} from 'fs'",
75
- "truncateSync": "import {truncateSync} from 'fs'",
76
- "unwatchFile": "import {unwatchFile} from 'fs'",
77
- "unlink": "import {unlink} from 'fs'",
78
- "unlinkSync": "import {unlinkSync} from 'fs'",
79
- "utimes": "import {utimes} from 'fs'",
80
- "utimesSync": "import {utimesSync} from 'fs'",
81
- "watch": "import {watch} from 'fs'",
82
- "watchFile": "import {watchFile} from 'fs'",
83
- "writeFile": "import {writeFile} from 'fs'",
84
- "writeFileSync": "import {writeFileSync} from 'fs'",
85
- "write": "import {write} from 'fs'",
86
- "writeSync": "import {writeSync} from 'fs'",
87
- "writev": "import {writev} from 'fs'",
88
- "writevSync": "import {writevSync} from 'fs'",
89
- "Dir": "import {Dir} from 'fs'",
90
- "Dirent": "import {Dirent} from 'fs'",
91
- "Stats": "import {Stats} from 'fs'",
92
- "ReadStream": "import {ReadStream} from 'fs'",
93
- "WriteStream": "import {WriteStream} from 'fs'",
94
- "FileReadStream": "import {FileReadStream} from 'fs'",
95
- "FileWriteStream": "import {FileWriteStream} from 'fs'",
96
- "F_OK": "import {F_OK} from 'fs'",
97
- "R_OK": "import {R_OK} from 'fs'",
98
- "W_OK": "import {W_OK} from 'fs'",
99
- "X_OK": "import {X_OK} from 'fs'"
100
- }
@@ -1,10 +0,0 @@
1
- {
2
- "builtinModules": "import {builtinModules} from 'module'",
3
- "globalPaths": "import {globalPaths} from 'module'",
4
- "createRequire": "import {createRequire} from 'module'",
5
- "syncBuiltinESMExports": "import {syncBuiltinESMExports} from 'module'",
6
- "Module": "import {Module} from 'module'",
7
- "runMain": "import {runMain} from 'module'",
8
- "findSourceMap": "import {findSourceMap} from 'module'",
9
- "SourceMap": "import {SourceMap} from 'module'"
10
- }
@@ -1,21 +0,0 @@
1
- {
2
- "arch": "import {arch} from 'os'",
3
- "cpus": "import {cpus} from 'os'",
4
- "endianness": "import {endianness} from 'os'",
5
- "freemem": "import {freemem} from 'os'",
6
- "getPriority": "import {getPriority} from 'os'",
7
- "homedir": "import {homedir} from 'os'",
8
- "hostname": "import {hostname} from 'os'",
9
- "loadavg": "import {loadavg} from 'os'",
10
- "networkInterfaces": "import {networkInterfaces} from 'os'",
11
- "platform": "import {platform} from 'os'",
12
- "release": "import {release} from 'os'",
13
- "setPriority": "import {setPriority} from 'os'",
14
- "tmpdir": "import {tmpdir} from 'os'",
15
- "totalmem": "import {totalmem} from 'os'",
16
- "userInfo": "import {userInfo} from 'os'",
17
- "uptime": "import {uptime} from 'os'",
18
- "constants": "import {constants} from 'os'",
19
- "EOL": "import {EOL} from 'os'",
20
- "devNull": "import {devNull} from 'os'"
21
- }
@@ -1,16 +0,0 @@
1
- {
2
- "resolve": "import {resolve} from 'path'",
3
- "normalize": "import {normalize} from 'path'",
4
- "isAbsolute": "import {isAbsolute} from 'path'",
5
- "join": "import {join} from 'path'",
6
- "relative": "import {relative} from 'path'",
7
- "toNamespacedPath": "import {toNamespacedPath} from 'path'",
8
- "dirname": "import {dirname} from 'path'",
9
- "basename": "import {basename} from 'path'",
10
- "extname": "import {extname} from 'path'",
11
- "format": "import {format} from 'path'",
12
- "sep": "import {sep} from 'path'",
13
- "delimiter": "import {delimiter} from 'path'",
14
- "win32": "import {win32} from 'path'",
15
- "posix": "import {posix} from 'path'"
16
- }
@@ -1,55 +0,0 @@
1
- {
2
- "process": "import process from 'process'",
3
- "arch": "import {arch} from 'process'",
4
- "platform": "import {platform} from 'process'",
5
- "release": "import {release} from 'process'",
6
- "moduleLoadList": "import {moduleLoadList} from 'process'",
7
- "binding": "import {binding} from 'process'",
8
- "domain": "import {domain} from 'process'",
9
- "config": "import {config} from 'process'",
10
- "dlopen": "import {dlopen} from 'process'",
11
- "uptime": "import {uptime} from 'process'",
12
- "reallyExit": "import {reallyExit} from 'process'",
13
- "cpuUsage": "import {cpuUsage} from 'process'",
14
- "resourceUsage": "import {resourceUsage} from 'process'",
15
- "memoryUsage": "import {memoryUsage} from 'process'",
16
- "kill": "import {kill} from 'process'",
17
- "exit": "import {exit} from 'process'",
18
- "openStdin": "import {openStdin} from 'process'",
19
- "getuid": "import {getuid} from 'process'",
20
- "geteuid": "import {geteuid} from 'process'",
21
- "getgid": "import {getgid} from 'process'",
22
- "getegid": "import {getegid} from 'process'",
23
- "getgroups": "import {getgroups} from 'process'",
24
- "allowedNodeEnvironmentFlags": "import {allowedNodeEnvironmentFlags} from 'process'",
25
- "assert": "import {assert} from 'process'",
26
- "features": "import {features} from 'process'",
27
- "setUncaughtExceptionCaptureCallback": "import {setUncaughtExceptionCaptureCallback} from 'process'",
28
- "hasUncaughtExceptionCaptureCallback": "import {hasUncaughtExceptionCaptureCallback} from 'process'",
29
- "emitWarning": "import {emitWarning} from 'process'",
30
- "nextTick": "import {nextTick} from 'process'",
31
- "stdout": "import {stdout} from 'process'",
32
- "stdin": "import {stdin} from 'process'",
33
- "stderr": "import {stderr} from 'process'",
34
- "abort": "import {abort} from 'process'",
35
- "umask": "import {umask} from 'process'",
36
- "chdir": "import {chdir} from 'process'",
37
- "cwd": "import {cwd} from 'process'",
38
- "initgroups": "import {initgroups} from 'process'",
39
- "setgroups": "import {setgroups} from 'process'",
40
- "setegid": "import {setegid} from 'process'",
41
- "seteuid": "import {seteuid} from 'process'",
42
- "setgid": "import {setgid} from 'process'",
43
- "setuid": "import {setuid} from 'process'",
44
- "argv": "import {argv} from 'process'",
45
- "execArgv": "import {execArgv} from 'process'",
46
- "pid": "import {pid} from 'process'",
47
- "ppid": "import {ppid} from 'process'",
48
- "execPath": "import {execPath} from 'process'",
49
- "debugPort": "import {debugPort} from 'process'",
50
- "hrtime": "import {hrtime} from 'process'",
51
- "argv0": "import {argv0} from 'process'",
52
- "throwDeprecation": "import {throwDeprecation} from 'process'",
53
- "setSourceMapsEnabled": "import {setSourceMapsEnabled} from 'process'",
54
- "mainModule": "import {mainModule} from 'process'"
55
- }
@@ -1,14 +0,0 @@
1
- {
2
- "isDisturbed": "import {isDisturbed} from 'stream'",
3
- "Readable": "import {Readable} from 'stream'",
4
- "Writable": "import {Writable} from 'stream'",
5
- "Duplex": "import {Duplex} from 'stream'",
6
- "Transform": "import {Transform} from 'stream'",
7
- "PassThrough": "import {PassThrough} from 'stream'",
8
- "pipeline": "import {pipeline} from 'stream'",
9
- "addAbortSignal": "import {addAbortSignal} from 'stream'",
10
- "finished": "import {finished} from 'stream'",
11
- "destroy": "import {destroy} from 'stream'",
12
- "compose": "import {compose} from 'stream'",
13
- "Stream": "import {Stream} from 'stream'"
14
- }
@@ -1,7 +0,0 @@
1
- {
2
- "domainToASCII": "import {domainToASCII} from 'url'",
3
- "domainToUnicode": "import {domainToUnicode} from 'url'",
4
- "pathToFileURL": "import {pathToFileURL} from 'url'",
5
- "fileURLToPath": "import {fileURLToPath} from 'url'",
6
- "urlToHttpOptions": "import {urlToHttpOptions} from 'url'"
7
- }
@@ -1,14 +0,0 @@
1
- {
2
- "callbackify": "import {callbackify} from 'util'",
3
- "formatWithOptions": "import {formatWithOptions} from 'util'",
4
- "getSystemErrorMap": "import {getSystemErrorMap} from 'util'",
5
- "getSystemErrorName": "import {getSystemErrorName} from 'util'",
6
- "inherits": "import {inherits} from 'util'",
7
- "inspect": "import {inspect} from 'util'",
8
- "isDeepStrictEqual": "import {isDeepStrictEqual} from 'util'",
9
- "promisify": "import {promisify} from 'util'",
10
- "stripVTControlCharacters": "import {stripVTControlCharacters} from 'util'",
11
- "toUSVString": "import {toUSVString} from 'util'",
12
- "TextDecoder": "import {TextDecoder} from 'util'",
13
- "TextEncoder": "import {TextEncoder} from 'util'"
14
- }
@@ -1,40 +0,0 @@
1
- {
2
- "Deflate": "import {Deflate} from 'zlib'",
3
- "Inflate": "import {Inflate} from 'zlib'",
4
- "Gzip": "import {Gzip} from 'zlib'",
5
- "Gunzip": "import {Gunzip} from 'zlib'",
6
- "DeflateRaw": "import {DeflateRaw} from 'zlib'",
7
- "InflateRaw": "import {InflateRaw} from 'zlib'",
8
- "Unzip": "import {Unzip} from 'zlib'",
9
- "BrotliCompress": "import {BrotliCompress} from 'zlib'",
10
- "BrotliDecompress": "import {BrotliDecompress} from 'zlib'",
11
- "deflate": "import {deflate} from 'zlib'",
12
- "deflateSync": "import {deflateSync} from 'zlib'",
13
- "gzip": "import {gzip} from 'zlib'",
14
- "gzipSync": "import {gzipSync} from 'zlib'",
15
- "deflateRaw": "import {deflateRaw} from 'zlib'",
16
- "deflateRawSync": "import {deflateRawSync} from 'zlib'",
17
- "unzip": "import {unzip} from 'zlib'",
18
- "unzipSync": "import {unzipSync} from 'zlib'",
19
- "inflate": "import {inflate} from 'zlib'",
20
- "inflateSync": "import {inflateSync} from 'zlib'",
21
- "gunzip": "import {gunzip} from 'zlib'",
22
- "gunzipSync": "import {gunzipSync} from 'zlib'",
23
- "inflateRaw": "import {inflateRaw} from 'zlib'",
24
- "inflateRawSync": "import {inflateRawSync} from 'zlib'",
25
- "brotliCompress": "import {brotliCompress} from 'zlib'",
26
- "brotliCompressSync": "import {brotliCompressSync} from 'zlib'",
27
- "brotliDecompress": "import {brotliDecompress} from 'zlib'",
28
- "brotliDecompressSync": "import {brotliDecompressSync} from 'zlib'",
29
- "createDeflate": "import {createDeflate} from 'zlib'",
30
- "createInflate": "import {createInflate} from 'zlib'",
31
- "createDeflateRaw": "import {createDeflateRaw} from 'zlib'",
32
- "createInflateRaw": "import {createInflateRaw} from 'zlib'",
33
- "createGzip": "import {createGzip} from 'zlib'",
34
- "createGunzip": "import {createGunzip} from 'zlib'",
35
- "createUnzip": "import {createUnzip} from 'zlib'",
36
- "createBrotliCompress": "import {createBrotliCompress} from 'zlib'",
37
- "createBrotliDecompress": "import {createBrotliDecompress} from 'zlib'",
38
- "constants": "import {constants} from 'zlib'",
39
- "codes": "import {codes} from 'zlib'"
40
- }