@tapjs/processinfo 1.0.12 → 2.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.
Files changed (166) hide show
  1. package/README.md +20 -11
  2. package/dist/cjs/argv-to-node-options.d.ts +2 -0
  3. package/dist/cjs/argv-to-node-options.d.ts.map +1 -0
  4. package/dist/cjs/argv-to-node-options.js +6 -0
  5. package/dist/cjs/argv-to-node-options.js.map +1 -0
  6. package/dist/cjs/child_process.d.ts +205 -0
  7. package/dist/cjs/child_process.d.ts.map +1 -0
  8. package/dist/cjs/child_process.js +109 -0
  9. package/dist/cjs/child_process.js.map +1 -0
  10. package/dist/cjs/cjs.d.ts +2 -0
  11. package/dist/cjs/cjs.d.ts.map +1 -0
  12. package/dist/cjs/cjs.js +5 -0
  13. package/dist/cjs/cjs.js.map +1 -0
  14. package/dist/cjs/get-exclude.d.ts +3 -0
  15. package/dist/cjs/get-exclude.d.ts.map +1 -0
  16. package/dist/cjs/get-exclude.js +23 -0
  17. package/dist/cjs/get-exclude.js.map +1 -0
  18. package/dist/cjs/get-process-info.d.ts +25 -0
  19. package/dist/cjs/get-process-info.d.ts.map +1 -0
  20. package/dist/cjs/get-process-info.js +69 -0
  21. package/dist/cjs/get-process-info.js.map +1 -0
  22. package/dist/cjs/index.d.ts +44 -0
  23. package/dist/cjs/index.d.ts.map +1 -0
  24. package/dist/cjs/index.js +148 -0
  25. package/dist/cjs/index.js.map +1 -0
  26. package/dist/cjs/json-file.d.ts +3 -0
  27. package/dist/cjs/json-file.d.ts.map +1 -0
  28. package/dist/cjs/json-file.js +20 -0
  29. package/dist/cjs/json-file.js.map +1 -0
  30. package/dist/cjs/loader-paths.d.ts +5 -0
  31. package/dist/cjs/loader-paths.d.ts.map +1 -0
  32. package/dist/cjs/loader-paths.js +35 -0
  33. package/dist/cjs/loader-paths.js.map +1 -0
  34. package/dist/cjs/node-options-env.d.ts +6 -0
  35. package/dist/cjs/node-options-env.d.ts.map +1 -0
  36. package/dist/cjs/node-options-env.js +58 -0
  37. package/dist/cjs/node-options-env.js.map +1 -0
  38. package/dist/cjs/node-options-to-argv.d.ts +2 -0
  39. package/dist/cjs/node-options-to-argv.d.ts.map +1 -0
  40. package/dist/cjs/node-options-to-argv.js +58 -0
  41. package/dist/cjs/node-options-to-argv.js.map +1 -0
  42. package/dist/cjs/package.json +3 -0
  43. package/dist/cjs/process-info-node.d.ts +24 -0
  44. package/dist/cjs/process-info-node.d.ts.map +1 -0
  45. package/dist/cjs/process-info-node.js +100 -0
  46. package/dist/cjs/process-info-node.js.map +1 -0
  47. package/dist/cjs/register-cjs.d.ts +2 -0
  48. package/dist/cjs/register-cjs.d.ts.map +1 -0
  49. package/dist/cjs/register-cjs.js +21 -0
  50. package/dist/cjs/register-cjs.js.map +1 -0
  51. package/dist/cjs/register-coverage.d.ts +7 -0
  52. package/dist/cjs/register-coverage.d.ts.map +1 -0
  53. package/dist/cjs/register-coverage.js +94 -0
  54. package/dist/cjs/register-coverage.js.map +1 -0
  55. package/dist/cjs/register-env.d.ts +2 -0
  56. package/dist/cjs/register-env.d.ts.map +1 -0
  57. package/dist/cjs/register-env.js +26 -0
  58. package/dist/cjs/register-env.js.map +1 -0
  59. package/dist/cjs/register-process-end.d.ts +2 -0
  60. package/dist/cjs/register-process-end.d.ts.map +1 -0
  61. package/dist/cjs/register-process-end.js +30 -0
  62. package/dist/cjs/register-process-end.js.map +1 -0
  63. package/dist/cjs/require-resolve-cjs.d.ts.map +1 -0
  64. package/dist/cjs/require-resolve-cjs.js.map +1 -0
  65. package/dist/cjs/require-resolve.d.ts +3 -0
  66. package/dist/cjs/require-resolve.js +9 -0
  67. package/dist/cjs/spawn-opts.d.ts +10 -0
  68. package/dist/cjs/spawn-opts.d.ts.map +1 -0
  69. package/dist/cjs/spawn-opts.js +18 -0
  70. package/dist/cjs/spawn-opts.js.map +1 -0
  71. package/dist/cjs/x.d.ts +2 -0
  72. package/dist/cjs/x.d.ts.map +1 -0
  73. package/dist/cjs/x.js +5 -0
  74. package/dist/cjs/x.js.map +1 -0
  75. package/dist/mjs/argv-to-node-options.d.ts +2 -0
  76. package/dist/mjs/argv-to-node-options.d.ts.map +1 -0
  77. package/dist/mjs/argv-to-node-options.js +2 -0
  78. package/dist/mjs/argv-to-node-options.js.map +1 -0
  79. package/dist/mjs/child_process.d.ts +205 -0
  80. package/dist/mjs/child_process.d.ts.map +1 -0
  81. package/dist/mjs/child_process.js +99 -0
  82. package/dist/mjs/child_process.js.map +1 -0
  83. package/dist/mjs/esm.d.mts +11 -0
  84. package/dist/mjs/esm.d.mts.map +1 -0
  85. package/dist/mjs/esm.mjs +45 -0
  86. package/dist/mjs/esm.mjs.map +1 -0
  87. package/dist/mjs/get-exclude.d.ts +3 -0
  88. package/dist/mjs/get-exclude.d.ts.map +1 -0
  89. package/dist/mjs/get-exclude.js +19 -0
  90. package/dist/mjs/get-exclude.js.map +1 -0
  91. package/dist/mjs/get-process-info.d.ts +25 -0
  92. package/dist/mjs/get-process-info.d.ts.map +1 -0
  93. package/dist/mjs/get-process-info.js +64 -0
  94. package/dist/mjs/get-process-info.js.map +1 -0
  95. package/dist/mjs/index.d.ts +44 -0
  96. package/dist/mjs/index.d.ts.map +1 -0
  97. package/dist/mjs/index.js +130 -0
  98. package/dist/mjs/index.js.map +1 -0
  99. package/dist/mjs/json-file.d.ts +3 -0
  100. package/dist/mjs/json-file.d.ts.map +1 -0
  101. package/dist/mjs/json-file.js +15 -0
  102. package/dist/mjs/json-file.js.map +1 -0
  103. package/dist/mjs/loader-paths.d.ts +5 -0
  104. package/dist/mjs/loader-paths.d.ts.map +1 -0
  105. package/dist/mjs/loader-paths.js +30 -0
  106. package/dist/mjs/loader-paths.js.map +1 -0
  107. package/dist/mjs/node-options-env.d.ts +6 -0
  108. package/dist/mjs/node-options-env.d.ts.map +1 -0
  109. package/dist/mjs/node-options-env.js +54 -0
  110. package/dist/mjs/node-options-env.js.map +1 -0
  111. package/dist/mjs/node-options-to-argv.d.ts +2 -0
  112. package/dist/mjs/node-options-to-argv.d.ts.map +1 -0
  113. package/dist/mjs/node-options-to-argv.js +54 -0
  114. package/dist/mjs/node-options-to-argv.js.map +1 -0
  115. package/dist/mjs/package.json +3 -0
  116. package/dist/mjs/process-info-node.d.ts +24 -0
  117. package/dist/mjs/process-info-node.d.ts.map +1 -0
  118. package/dist/mjs/process-info-node.js +96 -0
  119. package/dist/mjs/process-info-node.js.map +1 -0
  120. package/dist/mjs/register-cjs.d.ts +2 -0
  121. package/dist/mjs/register-cjs.d.ts.map +1 -0
  122. package/dist/mjs/register-cjs.js +17 -0
  123. package/dist/mjs/register-cjs.js.map +1 -0
  124. package/dist/mjs/register-coverage.d.ts +7 -0
  125. package/dist/mjs/register-coverage.d.ts.map +1 -0
  126. package/dist/mjs/register-coverage.js +89 -0
  127. package/dist/mjs/register-coverage.js.map +1 -0
  128. package/dist/mjs/register-env.d.ts +2 -0
  129. package/dist/mjs/register-env.d.ts.map +1 -0
  130. package/dist/mjs/register-env.js +19 -0
  131. package/dist/mjs/register-env.js.map +1 -0
  132. package/dist/mjs/register-process-end.d.ts +2 -0
  133. package/dist/mjs/register-process-end.d.ts.map +1 -0
  134. package/dist/mjs/register-process-end.js +26 -0
  135. package/dist/mjs/register-process-end.js.map +1 -0
  136. package/dist/mjs/require-resolve.d.ts +3 -0
  137. package/dist/mjs/require-resolve.d.ts.map +1 -0
  138. package/dist/mjs/require-resolve.js +9 -0
  139. package/dist/mjs/require-resolve.js.map +1 -0
  140. package/dist/mjs/spawn-opts.d.ts +10 -0
  141. package/dist/mjs/spawn-opts.d.ts.map +1 -0
  142. package/dist/mjs/spawn-opts.js +14 -0
  143. package/dist/mjs/spawn-opts.js.map +1 -0
  144. package/dist/mjs/x.d.ts +2 -0
  145. package/dist/mjs/x.d.ts.map +1 -0
  146. package/dist/mjs/x.js +2 -0
  147. package/dist/mjs/x.js.map +1 -0
  148. package/package.json +49 -19
  149. package/index.d.ts +0 -208
  150. package/lib/argv-to-node-options.cjs +0 -2
  151. package/lib/child_process.cjs +0 -81
  152. package/lib/cjs.cjs +0 -16
  153. package/lib/esm.mjs +0 -74
  154. package/lib/get-exclude.cjs +0 -21
  155. package/lib/get-process-info.cjs +0 -45
  156. package/lib/index.cjs +0 -163
  157. package/lib/index.d.cts +0 -208
  158. package/lib/index.d.ts +0 -208
  159. package/lib/json-file.cjs +0 -19
  160. package/lib/node-options-env.cjs +0 -100
  161. package/lib/node-options-to-argv.cjs +0 -52
  162. package/lib/process-info-node.cjs +0 -84
  163. package/lib/register-coverage.cjs +0 -74
  164. package/lib/register-env.cjs +0 -21
  165. package/lib/register-process-end.cjs +0 -29
  166. package/lib/spawn-opts.cjs +0 -16
package/lib/cjs.cjs DELETED
@@ -1,16 +0,0 @@
1
- // commonjs style loader hook
2
- const { getProcessInfo } = require('./get-process-info.cjs')
3
- const { getExclude } = require('./get-exclude.cjs')
4
-
5
- // have to make this a module-local, otherwise it reloads the info
6
- const processInfo = getProcessInfo()
7
- const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')
8
-
9
- const { addHook } = require('pirates')
10
-
11
- const matcher = filename => !exclude.test(filename)
12
- const hook = (code, filename) => {
13
- processInfo.files.push(filename)
14
- return code
15
- }
16
- addHook(hook, { exts: ['.js', '.cjs'], matcher })
package/lib/esm.mjs DELETED
@@ -1,74 +0,0 @@
1
- // usage: node '--loader=esm.mjs?other-loader&otherotherloader' foo.mjs
2
- import { fileURLToPath } from 'url'
3
- import { getProcessInfo } from './get-process-info.cjs'
4
- import { getExclude } from './get-exclude.cjs'
5
- import './cjs.cjs'
6
-
7
- // on Node v20, loaders are executed in a separate isolated environment
8
- // As a result, to register coverage and track files, we need to act in
9
- // the globalPreload function. The load() method posts a message with the
10
- // filename being loaded, because any registrations that happen in the
11
- // loader thread will not have any effect.
12
- // The check for the 'port' being undefined is to allow for support back to
13
- // 16.12, which had a globalPreload method, but did not have a sendMessage
14
- // port in that environment.
15
- let PORT = null
16
- export const globalPreload = context => {
17
- const loader = fileURLToPath(import.meta.url)
18
- const { port } = context || {}
19
- PORT = port
20
- return `
21
- if (typeof port !== 'undefined') {
22
- const { createRequire } = getBuiltin('module')
23
- const {pid, ppid} = getBuiltin('process')
24
- const require = createRequire(${JSON.stringify(loader)})
25
- const { getProcessInfo } = require('./get-process-info.cjs')
26
- const { getExclude } = require('./get-exclude.cjs')
27
- require('./cjs.cjs')
28
- const processInfo = getProcessInfo()
29
- port.onmessage = (e) => processInfo.files.push(e.data)
30
- port.unref()
31
- }
32
- `
33
- }
34
-
35
- const processInfo = getProcessInfo()
36
- const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')
37
-
38
- let others = await Promise.all(
39
- [...new URL(import.meta.url).searchParams.keys()].map(s =>
40
- import(s).catch(() => ({}))
41
- )
42
- )
43
-
44
- let hasLoad = others.filter(loader => typeof loader.load === 'function')
45
- let hasResolve = others.filter(loader => typeof loader.resolve === 'function')
46
-
47
- const myLoad = defaultFn => async (url, context) => {
48
- if (/^file:/.test(url)) {
49
- const filename = fileURLToPath(url)
50
- if (!exclude.test(filename)) {
51
- processInfo.files.push(filename)
52
- if (PORT) {
53
- PORT.postMessage(filename)
54
- }
55
- }
56
- }
57
- return defaultFn(url, context, defaultFn)
58
- }
59
-
60
- export const load = async (url, context, defaultFn) =>
61
- runAll(hasLoad, 'load', url, context, myLoad(defaultFn))
62
-
63
- export const resolve = async (url, context, defaultFn) =>
64
- runAll(hasResolve, 'resolve', url, context, defaultFn)
65
-
66
- const runAll = async (set, method, url, context, defaultFn, i = 0) => {
67
- if (i >= set.length) {
68
- return defaultFn(url, context, defaultFn)
69
- } else {
70
- return set[i][method](url, context, (url, context, _) =>
71
- runAll(set, method, url, context, defaultFn, i + 1)
72
- )
73
- }
74
- }
@@ -1,21 +0,0 @@
1
- const defaultExclude =
2
- /(^|[\\/])(node_modules|\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\/]+\.test\.[cm]?js|__tests?__)([\\/]|$)/i
3
-
4
- const parseExclude = src => {
5
- const parsed = src.match(/^\/(.*)\/([a-z]*)$/)
6
- if (parsed) {
7
- try {
8
- return new RegExp(parsed[1], parsed[2])
9
- } catch (e) {}
10
- }
11
- }
12
-
13
- const getExclude = k => {
14
- const src = process.env[k]
15
- const exclude = (src && parseExclude(src)) || defaultExclude
16
- process.env[k] = String(exclude)
17
- return exclude
18
- }
19
-
20
- exports.defaultExclude = defaultExclude
21
- exports.getExclude = getExclude
@@ -1,45 +0,0 @@
1
- const { v4: uuid } = require('uuid')
2
-
3
- const envKey = k => `_TAPJS_PROCESSINFO_${k.toUpperCase()}_`
4
- const getEnv = k => process.env[envKey(k)]
5
- const setEnv = (k, v) => (process.env[envKey(k)] = v)
6
- const delEnv = k => delete process.env[envKey(k)]
7
-
8
- let processInfo = null
9
- const getProcessInfo = () => {
10
- if (!processInfo) {
11
- require('./register-env.cjs')
12
- require('./register-coverage.cjs')
13
- require('./register-process-end.cjs')
14
- processInfo = {
15
- hrstart: process.hrtime(),
16
- date: new Date().toISOString(),
17
- argv: process.argv,
18
- execArgv: process.execArgv,
19
- NODE_OPTIONS: process.env.NODE_OPTIONS,
20
- cwd: process.cwd(),
21
- pid: process.pid,
22
- ppid: process.ppid,
23
- parent: getEnv('parent') || null,
24
- uuid: uuid(),
25
- files: [],
26
- }
27
-
28
- if (!processInfo.parent) {
29
- processInfo.root = processInfo.uuid
30
- setEnv('root', processInfo.uuid)
31
- } else {
32
- processInfo.root = getEnv('root')
33
- }
34
- // this is the parent of any further child processes
35
- setEnv('parent', processInfo.uuid)
36
- const externalID = getEnv('external_id')
37
- if (externalID) {
38
- processInfo.externalID = externalID
39
- // externalID only applies to ONE process, not all its children.
40
- delEnv('external_id')
41
- }
42
- }
43
- return processInfo
44
- }
45
- module.exports = { getProcessInfo }
package/lib/index.cjs DELETED
@@ -1,163 +0,0 @@
1
- const {
2
- spawn,
3
- spawnSync,
4
- exec,
5
- execSync,
6
- execFile,
7
- execFileSync,
8
- } = require('./child_process.cjs')
9
-
10
- const { resolve, basename } = require('path')
11
-
12
- const { ProcessInfoNode } = require('./process-info-node.cjs')
13
-
14
- const {
15
- writeFileSync,
16
- readdirSync,
17
- rmSync,
18
- rmdirSync,
19
- mkdirSync,
20
- } = require('fs')
21
- const { writeFile, readdir, rm, rmdir, mkdir } = require('fs/promises')
22
-
23
- const { safeJSONSync, safeJSON } = require('./json-file.cjs')
24
-
25
- class ProcessInfo {
26
- constructor({
27
- dir = resolve(process.cwd(), '.tap/processinfo'),
28
- exclude = /(^|\\|\/)node_modules(\\|\/|$)/,
29
- } = {}) {
30
- this.dir = dir
31
- this.exclude = exclude
32
- this.roots = new Set()
33
- this.files = new Map()
34
- this.uuids = new Map()
35
- this.pendingRoot = new Map()
36
- this.pendingParent = new Map()
37
- this.externalIDs = new Map()
38
- }
39
-
40
- clear() {
41
- this.roots.clear()
42
- this.files.clear()
43
- this.uuids.clear()
44
- this.externalIDs.clear()
45
- }
46
-
47
- async save() {
48
- await mkdir(this.dir, { recursive: true })
49
- const writes = []
50
- for (const [uuid, info] of this.uuids.entries()) {
51
- const f = `${this.dir}/${uuid}.json`
52
- writes.push(writeFile(f, JSON.stringify(info) + '\n', 'utf8'))
53
- }
54
- await Promise.all(writes)
55
- }
56
-
57
- async saveSync() {
58
- mkdirSync(this.dir, { recursive: true })
59
- for (const [uuid, info] of this.uuids.entries()) {
60
- const f = `${this.dir}/${uuid}.json`
61
- writeFileSync(f, JSON.stringify(info) + '\n', 'utf8')
62
- }
63
- }
64
-
65
- async erase() {
66
- this.clear()
67
- /* istanbul ignore next - node version compat */
68
- try {
69
- await rm(this.dir, { recursive: true })
70
- } catch (e) {
71
- await rmdir(this.dir, { recursive: true })
72
- }
73
- }
74
-
75
- eraseSync() {
76
- this.clear()
77
- /* istanbul ignore next - node version compat */
78
- try {
79
- rmSync(this.dir, { recursive: true })
80
- } catch (e) {
81
- rmdirSync(this.dir, { recursive: true })
82
- }
83
- }
84
-
85
- async load() {
86
- const promises = []
87
- for (const entry of await readdir(this.dir).catch(() => [])) {
88
- const uuid = basename(entry, '.json')
89
- if (this.uuids.has(uuid)) {
90
- continue
91
- }
92
- const f = resolve(this.dir, entry)
93
- promises.push(
94
- safeJSON(f).then(data => {
95
- if (!data.uuid || data.uuid !== uuid) {
96
- return
97
- }
98
- new ProcessInfoNode(data).link(this)
99
- })
100
- )
101
- }
102
- await Promise.all(promises)
103
-
104
- return this
105
- }
106
-
107
- loadSync() {
108
- let entries
109
- try {
110
- entries = readdirSync(this.dir)
111
- } catch (_) {
112
- entries = []
113
- }
114
- for (const entry of entries) {
115
- const uuid = basename(entry, '.json')
116
- if (this.uuids.has(uuid)) {
117
- continue
118
- }
119
- const f = resolve(this.dir, entry)
120
- const data = safeJSONSync(f)
121
- if (!data.uuid || data.uuid !== uuid) {
122
- continue
123
- }
124
- new ProcessInfoNode(data).link(this)
125
- }
126
-
127
- return this
128
- }
129
-
130
- static get Node() {
131
- return ProcessInfoNode
132
- }
133
-
134
- static get ProcessInfo() {
135
- return ProcessInfo
136
- }
137
-
138
- static get spawn() {
139
- return spawn
140
- }
141
-
142
- static get spawnSync() {
143
- return spawnSync
144
- }
145
-
146
- static get exec() {
147
- return exec
148
- }
149
-
150
- static get execSync() {
151
- return execSync
152
- }
153
-
154
- static get execFile() {
155
- return execFile
156
- }
157
-
158
- static get execFileSync() {
159
- return execFileSync
160
- }
161
- }
162
-
163
- module.exports = ProcessInfo
package/lib/index.d.cts DELETED
@@ -1,208 +0,0 @@
1
- /// <reference types="node" />
2
- import {
3
- ChildProcess,
4
- ExecException,
5
- ExecFileOptions,
6
- ExecFileSyncOptions,
7
- ExecOptions,
8
- ExecSyncOptions,
9
- SpawnOptions,
10
- SpawnSyncOptions,
11
- SpawnSyncReturns,
12
- } from 'node:child_process'
13
-
14
- declare interface ProcessInfoOptions {
15
- dir?: string
16
- exclude?: RegExp
17
- }
18
-
19
- declare class ProcessInfoNode {
20
- parent: ProcessInfoNode | null
21
- root: ProcessInfoNode | null
22
- children: ProcessInfoNode[] | null
23
- files: string[] | null
24
- externalID?: string | null
25
- uuid: string
26
- date: string
27
- argv: string[]
28
- execArgv: string[]
29
- pid: number
30
- ppid: number
31
- cwd: string
32
- code?: number | null
33
- signal: string | null
34
- runtime: number
35
- link(db: ProcessInfo): void
36
- NODE_OPTIONS?: string | null
37
- }
38
-
39
- declare interface ProcessInfoSpawnOptions extends SpawnOptions {
40
- externalID?: string
41
- }
42
-
43
- declare interface ProcessInfoSpawnSyncOptions extends SpawnSyncOptions {
44
- externalID?: string
45
- }
46
- declare interface ProcessInfoSpawnSyncOptionsWithStringEncoding
47
- extends ProcessInfoSpawnSyncOptions {
48
- encoding: BufferEncoding
49
- }
50
- interface ProcessInfoSpawnSyncOptionsWithBufferEncoding
51
- extends ProcessInfoSpawnSyncOptions {
52
- encoding?: 'buffer' | null | undefined
53
- }
54
-
55
- declare interface ProcessInfoExecSyncOptions extends ExecSyncOptions {
56
- externalID?: string
57
- }
58
- declare interface ProcessInfoExecSyncOptionsWithStringEncoding
59
- extends ProcessInfoExecSyncOptions {
60
- encoding: BufferEncoding
61
- }
62
- declare interface ProcessInfoExecSyncOptionsWithBufferEncoding
63
- extends ProcessInfoExecSyncOptions {
64
- encoding?: 'buffer' | null | undefined
65
- }
66
-
67
- declare interface ProcessInfoExecOptions extends ExecOptions {
68
- externalID?: string
69
- }
70
- declare interface ProcessInfoExecFileSyncOptions extends ExecFileSyncOptions {
71
- externalID?: string
72
- }
73
- declare interface ProcessInfoExecFileSyncOptionsWithStringEncoding
74
- extends ProcessInfoExecFileSyncOptions {
75
- encoding: BufferEncoding
76
- }
77
- declare interface ProcessInfoExecFileSyncOptionsWithBufferEncoding
78
- extends ProcessInfoExecFileSyncOptions {
79
- encoding?: 'buffer' | null | undefined
80
- }
81
- declare interface ProcessInfoExecFileOptions extends ExecFileOptions {
82
- externalID?: string
83
- }
84
-
85
- declare class ProcessInfo {
86
- public dir: string
87
- public exclude: RegExp
88
- public roots: Set<ProcessInfoNode>
89
- public files: Map<string, Set<ProcessInfoNode>>
90
- public uuids: Map<string, ProcessInfoNode>
91
- public externalIDs: Map<string, ProcessInfoNode>
92
-
93
- private pendingRoot: Map<string, ProcessInfoNode>
94
- private pendingParent: Map<string, ProcessInfoNode>
95
-
96
- constructor(options?: ProcessInfoOptions)
97
-
98
- save(): Promise<void>
99
- saveSync(): void
100
- erase(): Promise<void>
101
- eraseSync(): void
102
-
103
- load(): Promise<ProcessInfo>
104
- loadSync(): ProcessInfo
105
-
106
- static get Node(): typeof ProcessInfoNode
107
- static get ProcessInfo(): typeof ProcessInfo
108
-
109
- static spawn(
110
- cmd: string,
111
- args: string[],
112
- options: ProcessInfoSpawnOptions
113
- ): ChildProcess
114
-
115
- static spawnSync(cmd: string): SpawnSyncReturns<Buffer>
116
- static spawnSync(
117
- cmd: string,
118
- options: ProcessInfoSpawnSyncOptionsWithStringEncoding
119
- ): SpawnSyncReturns<string>
120
- static spawnSync(
121
- cmd: string,
122
- options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
123
- ): SpawnSyncReturns<Buffer>
124
- static spawnSync(
125
- cmd: string,
126
- options?: ProcessInfoSpawnSyncOptions
127
- ): SpawnSyncReturns<string | Buffer>
128
- static spawnSync(
129
- cmd: string,
130
- args: readonly string[]
131
- ): SpawnSyncReturns<Buffer>
132
- static spawnSync(
133
- cmd: string,
134
- args: readonly string[],
135
- options: ProcessInfoSpawnSyncOptionsWithStringEncoding
136
- ): SpawnSyncReturns<string>
137
- static spawnSync(
138
- cmd: string,
139
- args: readonly string[],
140
- options: ProcessInfoSpawnSyncOptionsWithBufferEncoding
141
- ): SpawnSyncReturns<Buffer>
142
- static spawnSync(
143
- cmd: string,
144
- args?: readonly string[],
145
- options?: ProcessInfoSpawnSyncOptions
146
- ): SpawnSyncReturns<string | Buffer>
147
-
148
- static exec(
149
- cmd: string,
150
- options: ProcessInfoExecOptions,
151
- callback?: (
152
- error: ExecException | null,
153
- stdout: Buffer,
154
- stderr: Buffer
155
- ) => void
156
- ): ChildProcess
157
-
158
- static execSync(
159
- cmd: string,
160
- options: ProcessInfoExecSyncOptionsWithStringEncoding
161
- ): string
162
- static execSync(
163
- cmd: string,
164
- options: ProcessInfoExecSyncOptionsWithBufferEncoding
165
- ): Buffer
166
- static execSync(
167
- cmd: string,
168
- options?: ProcessInfoExecSyncOptions
169
- ): string | Buffer
170
-
171
- static execFile(
172
- cmd: string,
173
- args: string[],
174
- options: ProcessInfoExecFileOptions
175
- ): ChildProcess
176
-
177
- static execFileSync(file: string): Buffer
178
- static execFileSync(
179
- file: string,
180
- options: ProcessInfoExecFileSyncOptionsWithStringEncoding
181
- ): string
182
- static execFileSync(
183
- file: string,
184
- options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
185
- ): Buffer
186
- static execFileSync(
187
- file: string,
188
- options?: ProcessInfoExecFileSyncOptions
189
- ): string | Buffer
190
- static execFileSync(file: string, args: readonly string[]): Buffer
191
- static execFileSync(
192
- file: string,
193
- args: readonly string[],
194
- options: ProcessInfoExecFileSyncOptionsWithStringEncoding
195
- ): string
196
- static execFileSync(
197
- file: string,
198
- args: readonly string[],
199
- options: ProcessInfoExecFileSyncOptionsWithBufferEncoding
200
- ): Buffer
201
- static execFileSync(
202
- file: string,
203
- args?: readonly string[],
204
- options?: ProcessInfoExecFileSyncOptions
205
- ): string | Buffer
206
- }
207
-
208
- export = ProcessInfo