Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created June 18, 2018 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/1ae044fa9ba7a0ce997f7d8c049f8e90 to your computer and use it in GitHub Desktop.
Save kunigami/1ae044fa9ba7a0ce997f7d8c049f8e90 to your computer and use it in GitHub Desktop.
external readFile :
name:string ->
([ `utf8
| `useAscii [@bs.as "ascii"]
] [@bs.string]) ->
(string -> string -> unit) ->
unit = ""
[@@bs.module "fs"]
let callback error data = Js.log(data)
let _ = readFile ~name:"data.json" `utf8 callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment