-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplfy require code, fix __dirname and __filename
- Loading branch information
1 parent
6662f25
commit 4e80a2f
Showing
11 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
OCaml bindings for nodejs | ||
Write OCaml, run on node | ||
|
||
These are OCaml bindings to Nodejs Get all the power of the Nodejs | ||
ecosystem with the type safety of OCaml. | ||
These are js_of_ocaml bindings to the node JavaScript API. | ||
Get all the power of the node ecosystem with the type safety | ||
of OCaml. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
let require (s : Js.js_string Js.t) = | ||
Js.Unsafe.fun_call (Js.Unsafe.js_expr "require") [|Js.Unsafe.inject s|] | ||
let require s = | ||
Js.Unsafe.fun_call | ||
(Js.Unsafe.js_expr "require") | ||
[|Js.Unsafe.inject (Js.string s)|] | ||
|
||
let console : Js.Unsafe.any Js.t = Js.Unsafe.global##.console | ||
|
||
let __filename () : Js.js_string Js.t = Js.Unsafe.global##.__filename | ||
let __filename () = | ||
(Js.Unsafe.eval_string "__filename" : Js.js_string Js.t) | ||
|> Js.to_string | ||
|
||
let __dirname () : Js.js_string Js.t = Js.Unsafe.global##.__dirname | ||
let __dirname () = | ||
(Js.Unsafe.eval_string "__dirname" : Js.js_string Js.t) | ||
|> Js.to_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
class type process = object | ||
|
||
method version : Js.js_string Js.t Js.readonly_prop | ||
|
||
method platform : Js.js_string Js.t Js.readonly_prop | ||
|
||
end | ||
|
||
let process : process Js.t = Js.Unsafe.global##.process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters