@idlebox/node 1.4.11 → 1.4.13

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 (45) hide show
  1. package/lib/asyncLoad.d.ts +1 -0
  2. package/lib/asyncLoad.d.ts.map +1 -1
  3. package/lib/asyncLoad.js +3 -2
  4. package/lib/asyncLoad.js.map +1 -1
  5. package/lib/autoindex.d.ts +73 -76
  6. package/lib/autoindex.d.ts.map +1 -1
  7. package/lib/autoindex.js +65 -68
  8. package/lib/autoindex.js.map +1 -1
  9. package/lib/child_process/respawn.d.ts +2 -0
  10. package/lib/child_process/respawn.d.ts.map +1 -1
  11. package/lib/child_process/respawn.js +2 -0
  12. package/lib/child_process/respawn.js.map +1 -1
  13. package/lib/fs/exists.js +1 -1
  14. package/lib/fs/exists.js.map +1 -1
  15. package/lib/lifecycle/register.d.ts +11 -1
  16. package/lib/lifecycle/register.d.ts.map +1 -1
  17. package/lib/lifecycle/register.js +152 -51
  18. package/lib/lifecycle/register.js.map +1 -1
  19. package/lib/lifecycle/workingDirectory.d.ts +11 -0
  20. package/lib/lifecycle/workingDirectory.d.ts.map +1 -0
  21. package/lib/lifecycle/workingDirectory.js +40 -0
  22. package/lib/lifecycle/workingDirectory.js.map +1 -0
  23. package/lib/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +10 -11
  25. package/src/asyncLoad.ts +3 -2
  26. package/src/autoindex.ts +109 -115
  27. package/src/child_process/respawn.ts +2 -0
  28. package/src/fs/exists.ts +1 -1
  29. package/src/lifecycle/register.ts +152 -53
  30. package/src/lifecycle/workingDirectory.ts +45 -0
  31. package/lib/autoindex.generated.d.ts +0 -80
  32. package/lib/autoindex.generated.d.ts.map +0 -1
  33. package/lib/autoindex.generated.js +0 -132
  34. package/lib/autoindex.generated.js.map +0 -1
  35. package/lib/error/linux.d.ts +0 -125
  36. package/lib/error/linux.d.ts.map +0 -1
  37. package/lib/error/linux.js +0 -126
  38. package/lib/error/linux.js.map +0 -1
  39. package/lib/error/types.d.ts +0 -24
  40. package/lib/error/types.d.ts.map +0 -1
  41. package/lib/error/types.js +0 -25
  42. package/lib/error/types.js.map +0 -1
  43. package/src/autoindex.generated.ts +0 -159
  44. package/src/error/linux.ts +0 -124
  45. package/src/error/types.ts +0 -39
@@ -1,159 +0,0 @@
1
- // DO NOT EDIT THIS FILE
2
- // @ts-ignore
3
- /* eslint-disable */
4
-
5
- /* asyncLoad.ts */
6
- // Identifiers
7
- export type { AsyncMainFunction } from "./asyncLoad.js";
8
- export { executeMainFunction } from "./asyncLoad.js";
9
- /* child_process/error.ts */
10
- // Identifiers
11
- export { checkChildProcessResult } from "./child_process/error.js";
12
- /* child_process/execa.ts */
13
- // Identifiers
14
- export type { ICommand } from "./child_process/execa.js";
15
- export { spawnWithoutOutputSync } from "./child_process/execa.js";
16
- export { spawnWithoutOutput } from "./child_process/execa.js";
17
- export { spawnGetOutputSync } from "./child_process/execa.js";
18
- export { spawnGetOutput } from "./child_process/execa.js";
19
- export { spawnGetEverything } from "./child_process/execa.js";
20
- /* cli-io/output.ts */
21
- // Identifiers
22
- export { printLine } from "./cli-io/output.js";
23
- /* child_process/lateError.ts */
24
- // Identifiers
25
- export type { ISpawnOptions } from "./child_process/lateError.js";
26
- export type { ExecaReturnValue } from "./child_process/lateError.js";
27
- export { execLazyError } from "./child_process/lateError.js";
28
- /* error/linux.ts */
29
- // Identifiers
30
- export { LinuxError } from "./error/linux.js";
31
- /* error/types.ts */
32
- // Identifiers
33
- export type { OpenSSLException } from "./error/types.js";
34
- export { isModuleResolutionError } from "./error/types.js";
35
- export { isNotExistsError } from "./error/types.js";
36
- export { isExistsError } from "./error/types.js";
37
- export { isTypeError } from "./error/types.js";
38
- export { isFileTypeError } from "./error/types.js";
39
- export { isNodeError } from "./error/types.js";
40
- // References
41
- export * from "@idlebox/node-error-codes";
42
- /* fs/exists.ts */
43
- // Identifiers
44
- export { existsSync } from "./fs/exists.js";
45
- export { exists } from "./fs/exists.js";
46
- export { readFileIfExists } from "./fs/exists.js";
47
- /* environment/getEnvironment.ts */
48
- // Identifiers
49
- export type { IEnvironmentResult } from "./environment/getEnvironment.js";
50
- export { getEnvironment } from "./environment/getEnvironment.js";
51
- export { deleteEnvironment } from "./environment/getEnvironment.js";
52
- export { cleanupEnvironment } from "./environment/getEnvironment.js";
53
- /* environment/pathEnvironment.ts */
54
- // Identifiers
55
- export { PATH_SEPARATOR } from "./environment/pathEnvironment.js";
56
- export { PathEnvironment } from "./environment/pathEnvironment.js";
57
- /* environment/findBinary.ts */
58
- // Identifiers
59
- export { findBinary } from "./environment/findBinary.js";
60
- /* child_process/respawn.ts */
61
- // Identifiers
62
- export { spawnRecreateEventHandlers } from "./child_process/respawn.js";
63
- export { trySpawnInScope } from "./child_process/respawn.js";
64
- export { respawnInScope } from "./child_process/respawn.js";
65
- /* crypto/md5.ts */
66
- // Identifiers
67
- export { md5 } from "./crypto/md5.js";
68
- /* crypto/sha256.ts */
69
- // Identifiers
70
- export { sha256 } from "./crypto/sha256.js";
71
- /* environment/npmConfig.ts */
72
- // Identifiers
73
- export { getNpmConfigValue } from "./environment/npmConfig.js";
74
- /* events/dumpEventEmitter.ts */
75
- // Identifiers
76
- export { dumpEventEmitterEmit } from "./events/dumpEventEmitter.js";
77
- /* fs/commandExists.ts */
78
- // Identifiers
79
- export { commandInPath } from "./fs/commandExists.js";
80
- export { commandInPathSync } from "./fs/commandExists.js";
81
- /* fs/emptyDir.ts */
82
- // Identifiers
83
- export { emptyDir } from "./fs/emptyDir.js";
84
- /* fs/ensureDir.ts */
85
- // Identifiers
86
- export { ensureDirExists } from "./fs/ensureDir.js";
87
- export { ensureParentExists } from "./fs/ensureDir.js";
88
- /* fs/tempFolder.ts */
89
- // Identifiers
90
- export { createTempFolder } from "./fs/tempFolder.js";
91
- /* fs/weiteChanged.ts */
92
- // Identifiers
93
- export { writeFileIfChangeSync } from "./fs/weiteChanged.js";
94
- export { writeFileIfChange } from "./fs/weiteChanged.js";
95
- /* lifecycle/register.ts */
96
- // Identifiers
97
- export { shutdown } from "./lifecycle/register.js";
98
- export { registerNodejsExitHandler } from "./lifecycle/register.js";
99
- export { die } from "./lifecycle/register.js";
100
- /* log/terminal.ts */
101
- // Identifiers
102
- export { WrappedTerminalConsole } from "./log/terminal.js";
103
- /* path-resolve/findUp.ts */
104
- // Identifiers
105
- export type { IFindOptions } from "./path-resolve/findUp.js";
106
- export { findUpUntil } from "./path-resolve/findUp.js";
107
- export { findUp } from "./path-resolve/findUp.js";
108
- export { findUpUntilSync } from "./path-resolve/findUp.js";
109
- export { findUpSync } from "./path-resolve/findUp.js";
110
- /* path-resolve/findPackageRoot.ts */
111
- // Identifiers
112
- export { findPackageRoot } from "./path-resolve/findPackageRoot.js";
113
- /* path-resolve/getAllUp.ts */
114
- // Identifiers
115
- export { getAllPathUpToRoot } from "./path-resolve/getAllUp.js";
116
- /* path-resolve/lrelative.ts */
117
- // Identifiers
118
- export { lrelative } from "./path-resolve/lrelative.js";
119
- /* path-resolve/nodeResolvePathArray.ts */
120
- // Identifiers
121
- export { nodeResolvePathArray } from "./path-resolve/nodeResolvePathArray.js";
122
- /* path-resolve/resolvePath.ts */
123
- // Identifiers
124
- export type { ResolvePathFunction } from "./path-resolve/resolvePath.js";
125
- export type { JoinPathFunction } from "./path-resolve/resolvePath.js";
126
- export { resolvePath } from "./path-resolve/resolvePath.js";
127
- export type { NormalizePathFunction } from "./path-resolve/resolvePath.js";
128
- export { normalizePath } from "./path-resolve/resolvePath.js";
129
- export { osTempDir } from "./path-resolve/resolvePath.js";
130
- export { relativePath } from "./path-resolve/resolvePath.js";
131
- /* stream/blackHoleStream.ts */
132
- // Identifiers
133
- export { BlackHoleStream } from "./stream/blackHoleStream.js";
134
- /* stream/streamPromise.ts */
135
- // Identifiers
136
- export { streamPromise } from "./stream/streamPromise.js";
137
- export { streamHasEnd } from "./stream/streamPromise.js";
138
- /* stream/collectingStream.ts */
139
- // Identifiers
140
- export { streamToBuffer } from "./stream/collectingStream.js";
141
- export { RawCollectingStream } from "./stream/collectingStream.js";
142
- export { CollectingStream } from "./stream/collectingStream.js";
143
- /* stream/disposableStream.ts */
144
- // Identifiers
145
- export { disposableStream } from "./stream/disposableStream.js";
146
- /* stream/drainStream.ts */
147
- // Identifiers
148
- export { drainStream } from "./stream/drainStream.js";
149
- /* stream/loggerStream.ts */
150
- // Identifiers
151
- export type { LogFunction } from "./stream/loggerStream.js";
152
- export { LoggerStream } from "./stream/loggerStream.js";
153
- export { HexDumpLoggerStream } from "./stream/loggerStream.js";
154
- /* autoindex.ts */
155
- // Identifiers
156
- // References
157
- export * from "@idlebox/node-error-codes";
158
- /* preload.ts */
159
- // Identifiers
@@ -1,124 +0,0 @@
1
- export enum LinuxError {
2
- EPERM = 'EPERM' /* Not super-user */,
3
- ENOENT = 'ENOENT' /* No such file or directory */,
4
- ESRCH = 'ESRCH' /* No such process */,
5
- EINTR = 'EINTR' /* Interrupted system call */,
6
- EIO = 'EIO' /* I/O error */,
7
- ENXIO = 'ENXIO' /* No such device or address */,
8
- E2BIG = 'E2BIG' /* Arg list too long */,
9
- ENOEXEC = 'ENOEXEC' /* Exec format error */,
10
- EBADF = 'EBADF' /* Bad file number */,
11
- ECHILD = 'ECHILD' /* No children */,
12
- EAGAIN = 'EAGAIN' /* No more processes */,
13
- ENOMEM = 'ENOMEM' /* Not enough core */,
14
- EACCES = 'EACCES' /* Permission denied */,
15
- EFAULT = 'EFAULT' /* Bad address */,
16
- ENOTBLK = 'ENOTBLK' /* Block device required */,
17
- EBUSY = 'EBUSY' /* Mount device busy */,
18
- EEXIST = 'EEXIST' /* File exists */,
19
- EXDEV = 'EXDEV' /* Cross-device link */,
20
- ENODEV = 'ENODEV' /* No such device */,
21
- ENOTDIR = 'ENOTDIR' /* Not a directory */,
22
- EISDIR = 'EISDIR' /* Is a directory */,
23
- EINVAL = 'EINVAL' /* Invalid argument */,
24
- ENFILE = 'ENFILE' /* Too many open files in system */,
25
- EMFILE = 'EMFILE' /* Too many open files */,
26
- ENOTTY = 'ENOTTY' /* Not a typewriter */,
27
- ETXTBSY = 'ETXTBSY' /* Text file busy */,
28
- EFBIG = 'EFBIG' /* File too large */,
29
- ENOSPC = 'ENOSPC' /* No space left on device */,
30
- ESPIPE = 'ESPIPE' /* Illegal seek */,
31
- EROFS = 'EROFS' /* Read only file system */,
32
- EMLINK = 'EMLINK' /* Too many links */,
33
- EPIPE = 'EPIPE' /* Broken pipe */,
34
- EDOM = 'EDOM' /* Math arg out of domain of func */,
35
- ERANGE = 'ERANGE' /* Math result not representable */,
36
- ENOMSG = 'ENOMSG' /* No message of desired type */,
37
- EIDRM = 'EIDRM' /* Identifier removed */,
38
- ECHRNG = 'ECHRNG' /* Channel number out of range */,
39
- EL2NSYNC = 'EL2NSYNC' /* Level 2 not synchronized */,
40
- EL3HLT = 'EL3HLT' /* Level 3 halted */,
41
- EL3RST = 'EL3RST' /* Level 3 reset */,
42
- ELNRNG = 'ELNRNG' /* Link number out of range */,
43
- EUNATCH = 'EUNATCH' /* Protocol driver not attached */,
44
- ENOCSI = 'ENOCSI' /* No CSI structure available */,
45
- EL2HLT = 'EL2HLT' /* Level 2 halted */,
46
- EDEADLK = 'EDEADLK' /* Deadlock condition */,
47
- ENOLCK = 'ENOLCK' /* No record locks available */,
48
- EBADE = 'EBADE' /* Invalid exchange */,
49
- EBADR = 'EBADR' /* Invalid request descriptor */,
50
- EXFULL = 'EXFULL' /* Exchange full */,
51
- ENOANO = 'ENOANO' /* No anode */,
52
- EBADRQC = 'EBADRQC' /* Invalid request code */,
53
- EBADSLT = 'EBADSLT' /* Invalid slot */,
54
- EDEADLOCK = 'EDEADLOCK' /* File locking deadlock error */,
55
- EBFONT = 'EBFONT' /* Bad font file fmt */,
56
- ENOSTR = 'ENOSTR' /* Device not a stream */,
57
- ENODATA = 'ENODATA' /* No data (for no delay io) */,
58
- ETIME = 'ETIME' /* Timer expired */,
59
- ENOSR = 'ENOSR' /* Out of streams resources */,
60
- ENONET = 'ENONET' /* Machine is not on the network */,
61
- ENOPKG = 'ENOPKG' /* Package not installed */,
62
- EREMOTE = 'EREMOTE' /* The object is remote */,
63
- ENOLINK = 'ENOLINK' /* The link has been severed */,
64
- EADV = 'EADV' /* Advertise error */,
65
- ESRMNT = 'ESRMNT' /* Srmount error */,
66
- ECOMM = 'ECOMM' /* Communication error on send */,
67
- EPROTO = 'EPROTO' /* Protocol error */,
68
- EMULTIHOP = 'EMULTIHOP' /* Multihop attempted */,
69
- ELBIN = 'ELBIN' /* Inode is remote (not really error) */,
70
- EDOTDOT = 'EDOTDOT' /* Cross mount point (not really error) */,
71
- EBADMSG = 'EBADMSG' /* Trying to read unreadable message */,
72
- EFTYPE = 'EFTYPE' /* Inappropriate file type or format */,
73
- ENOTUNIQ = 'ENOTUNIQ' /* Given log. name not unique */,
74
- EBADFD = 'EBADFD' /* f.d. invalid for this operation */,
75
- EREMCHG = 'EREMCHG' /* Remote address changed */,
76
- ELIBACC = 'ELIBACC' /* Can't access a needed shared lib */,
77
- ELIBBAD = 'ELIBBAD' /* Accessing a corrupted shared lib */,
78
- ELIBSCN = 'ELIBSCN' /* .lib section in a.out corrupted */,
79
- ELIBMAX = 'ELIBMAX' /* Attempting to link in too many libs */,
80
- ELIBEXEC = 'ELIBEXEC' /* Attempting to exec a shared library */,
81
- ENOSYS = 'ENOSYS' /* Function not implemented */,
82
- ENMFILE = 'ENMFILE' /* No more files */,
83
- ENOTEMPTY = 'ENOTEMPTY' /* Directory not empty */,
84
- ENAMETOOLONG = 'ENAMETOOLONG' /* File or path name too long */,
85
- ELOOP = 'ELOOP' /* Too many symbolic links */,
86
- EOPNOTSUPP = 'EOPNOTSUPP' /* Operation not supported on transport endpoint */,
87
- EPFNOSUPPORT = 'EPFNOSUPPORT' /* Protocol family not supported */,
88
- ECONNRESET = 'ECONNRESET' /* Connection reset by peer */,
89
- ENOBUFS = 'ENOBUFS' /* No buffer space available */,
90
- EAFNOSUPPORT = 'EAFNOSUPPORT' /* Address family not supported by protocol family */,
91
- EPROTOTYPE = 'EPROTOTYPE' /* Protocol wrong type for socket */,
92
- ENOTSOCK = 'ENOTSOCK' /* Socket operation on non-socket */,
93
- ENOPROTOOPT = 'ENOPROTOOPT' /* Protocol not available */,
94
- ESHUTDOWN = 'ESHUTDOWN' /* Can't send after socket shutdown */,
95
- ECONNREFUSED = 'ECONNREFUSED' /* Connection refused */,
96
- EADDRINUSE = 'EADDRINUSE' /* Address already in use */,
97
- ECONNABORTED = 'ECONNABORTED' /* Connection aborted */,
98
- ENETUNREACH = 'ENETUNREACH' /* Network is unreachable */,
99
- ENETDOWN = 'ENETDOWN' /* Network interface is not configured */,
100
- ETIMEDOUT = 'ETIMEDOUT' /* Connection timed out */,
101
- EHOSTDOWN = 'EHOSTDOWN' /* Host is down */,
102
- EHOSTUNREACH = 'EHOSTUNREACH' /* Host is unreachable */,
103
- EINPROGRESS = 'EINPROGRESS' /* Connection already in progress */,
104
- EALREADY = 'EALREADY' /* Socket already connected */,
105
- EDESTADDRREQ = 'EDESTADDRREQ' /* Destination address required */,
106
- EMSGSIZE = 'EMSGSIZE' /* Message too long */,
107
- EPROTONOSUPPORT = 'EPROTONOSUPPORT' /* Unknown protocol */,
108
- ESOCKTNOSUPPORT = 'ESOCKTNOSUPPORT' /* Socket type not supported */,
109
- EADDRNOTAVAIL = 'EADDRNOTAVAIL' /* Address not available */,
110
- ENETRESET = 'ENETRESET',
111
- EISCONN = 'EISCONN' /* Socket is already connected */,
112
- ENOTCONN = 'ENOTCONN' /* Socket is not connected */,
113
- ETOOMANYREFS = 'ETOOMANYREFS',
114
- EPROCLIM = 'EPROCLIM',
115
- EUSERS = 'EUSERS',
116
- EDQUOT = 'EDQUOT',
117
- ESTALE = 'ESTALE',
118
- ENOTSUP = 'ENOTSUP' /* Not supported */,
119
- ENOMEDIUM = 'ENOMEDIUM' /* No medium (in tape drive) */,
120
- ENOSHARE = 'ENOSHARE' /* No such host or network path */,
121
- ECASECLASH = 'ECASECLASH' /* Filename exists with different case */,
122
- EILSEQ = 'EILSEQ',
123
- EOVERFLOW = 'EOVERFLOW' /* Value too large for defined data type */,
124
- }
@@ -1,39 +0,0 @@
1
- import { NodeError } from '@idlebox/node-error-codes';
2
- import { LinuxError } from './linux.js';
3
- export * from '@idlebox/node-error-codes';
4
-
5
- type NodeException<T extends string = any> = NodeJS.ErrnoException & { code: T };
6
-
7
- export interface OpenSSLException extends Error {
8
- opensslErrorStack?: string;
9
- function?: string;
10
- library?: string;
11
- reason?: string;
12
- }
13
-
14
- /**
15
- * MODULE_NOT_FOUND: require() not found
16
- * ERR_MODULE_NOT_FOUND: import() not found
17
- */
18
- export function isModuleResolutionError(ex: unknown): ex is NodeException<NodeError.MODULE_NOT_FOUND | NodeError.ERR_MODULE_NOT_FOUND> {
19
- return isNodeError(ex) && (ex.code === NodeError.MODULE_NOT_FOUND || ex.code === NodeError.ERR_MODULE_NOT_FOUND);
20
- }
21
-
22
- export function isNotExistsError(e: unknown): e is NodeException<LinuxError.ENOENT> {
23
- return isNodeError(e) && e.code === LinuxError.ENOENT;
24
- }
25
-
26
- export function isExistsError(e: unknown): e is NodeException<LinuxError.EEXIST> {
27
- return isNodeError(e) && e.code === LinuxError.EEXIST;
28
- }
29
-
30
- /** @description use isFileTypeError */
31
- export const isTypeError = isFileTypeError;
32
-
33
- export function isFileTypeError(e: unknown): e is NodeException<LinuxError.EISDIR | LinuxError.ENOTDIR> {
34
- return isNodeError(e) && (e.code === LinuxError.EISDIR || e.code === LinuxError.ENOTDIR);
35
- }
36
-
37
- export function isNodeError(e: unknown): e is NodeException {
38
- return e instanceof Error && typeof (e as any).code === 'string';
39
- }