11module Path = {
2- @module ("path" ) external join2 : (string , string ) => string = "join"
32 @module ("path" ) @variadic external join : array <string > => string = "join"
43 @module ("path" ) external dirname : string => string = "dirname"
54}
65
76module Process = {
8- @scope ("process" ) external exit : int => unit = "exit"
9- @scope (("process" , "stderr" ))
10- external stderrWrite : string => unit = "write"
117 @scope ("process" ) external cwd : unit => string = "cwd"
12- @val @scope ("process" )
13- external argv : array <string > = "argv"
148}
159
1610module Fs = {
17- @module ("fs" ) external existsSync : string => bool = "existsSync"
1811 @module ("fs" ) external readdirSync : string => array <string > = "readdirSync"
1912 @module ("node:fs/promises" ) external writeFile : (string , string ) => promise <unit > = "writeFile"
2013}
@@ -25,46 +18,23 @@ module Buffer = {
2518}
2619
2720module ChildProcess = {
28- type spawnSyncReturns = {stdout : Buffer .t }
29- @module ("child_process" )
30- external spawnSync : (string , array <string >) => spawnSyncReturns = "spawnSync"
31-
3221 type readable
3322 type spawnReturns = {stderr : readable , stdout : readable }
3423 type options = {cwd ?: string , env ?: Dict .t <string >, timeout ?: int }
3524 @module ("child_process" )
3625 external spawn : (string , array <string >, ~options : options = ?) => spawnReturns = "spawn"
3726
3827 @send external on : (readable , string , Buffer .t => unit ) => unit = "on"
39- @send external onFromSpawn : (spawnReturns , string , Js .Null .t <float > => unit ) => unit = "on"
4028 @send
4129 external once : (spawnReturns , string , (Js .Null .t <float >, Js .Null .t <string >) => unit ) => unit =
4230 "once"
43- @send
44- external onceError : (spawnReturns , string , Js .Exn .t => unit ) => unit = "once"
4531}
4632
4733module OS = {
48- @module ("os" )
49- external tmpdir : unit => string = "tmpdir"
50-
5134 @module ("os" )
5235 external cpus : unit => array <{.}> = "cpus"
5336}
5437
55- module Util = {
56- type arg = {@as ("type" ) type_ : string }
57- type config = {
58- args : array <string >,
59- options : Dict .t <arg >,
60- }
61- type parsed = {
62- values : Dict .t <string >,
63- positionals : array <string >,
64- }
65- @module ("node:util" ) external parseArgs : config => parsed = "parseArgs"
66- }
67-
6838module URL = {
6939 @module ("url" ) external fileURLToPath : string => string = "fileURLToPath"
7040}
0 commit comments