Commit a28b449 1 parent c6ef223 commit a28b449 Copy full SHA for a28b449
File tree 1 file changed +59
-6
lines changed
elide/runtime/js/modules/process
1 file changed +59
-6
lines changed Original file line number Diff line number Diff line change 18
18
*/
19
19
20
20
function intrinsic ( ) : any {
21
- // @ts -expect-error intrinsic symbol
22
- const api = __Elide_node_process__ ;
23
- if ( ! api ) {
24
- throw new Error ( `The 'process' module failed to load the intrinsic API.` ) ;
25
- }
21
+ const api = globalThis [ '__Elide_node_process__' ] ;
22
+ if ( ! api ) throw new Error ( `The 'process' module failed to load the intrinsic API.` ) ;
26
23
return api || { } ;
27
24
}
28
25
@@ -81,12 +78,40 @@ export interface NodeProcessAPI {
81
78
*/
82
79
pid : number ;
83
80
81
+ /**
82
+ * Property: `stdout`.
83
+ *
84
+ * Access to standard output.
85
+ */
86
+ stdout : any ;
87
+
88
+ /**
89
+ * Property: `stderr`.
90
+ *
91
+ * Access to standard error output.
92
+ */
93
+ stderr : any ;
94
+
95
+ /**
96
+ * Property: `stdin`.
97
+ *
98
+ * Access to standard input.
99
+ */
100
+ stdin : any ;
101
+
102
+ /**
103
+ * Property: `title`.
104
+ *
105
+ * Access to the current process title.
106
+ */
107
+ title : string ;
108
+
84
109
/**
85
110
* Property: `cwd`.
86
111
*
87
112
* The current working directory.
88
113
*/
89
- cwd : string ;
114
+ cwd : ( ) => string ;
90
115
91
116
/**
92
117
* Property: `exit`.
@@ -163,6 +188,34 @@ export const pid = getProcessAPI().pid;
163
188
*/
164
189
export const cwd = getProcessAPI ( ) . cwd ;
165
190
191
+ /**
192
+ * Property: `stdout`.
193
+ *
194
+ * Standard output stream.
195
+ */
196
+ export const stdout = getProcessAPI ( ) . stdout ;
197
+
198
+ /**
199
+ * Property: `stderr`.
200
+ *
201
+ * Standard error output stream.
202
+ */
203
+ export const stderr = getProcessAPI ( ) . stderr ;
204
+
205
+ /**
206
+ * Property: `stdin`.
207
+ *
208
+ * Standard input stream.
209
+ */
210
+ export const stdin = getProcessAPI ( ) . stdin ;
211
+
212
+ /**
213
+ * Property: `title`.
214
+ *
215
+ * Standard input stream.
216
+ */
217
+ export const title = getProcessAPI ( ) . title ;
218
+
166
219
/**
167
220
* Property: `exit`.
168
221
*
You can’t perform that action at this time.
0 commit comments