Module Node.Fs

Node FS API

let readdirSync: string => array(string);

Most fs functions let you omit the callback argument. If you do, a default callback is used that rethrows errors. To get a trace to the original call site, set the `NODE_DEBUG` environment variable:

let renameSync: string => string => unit;
type fd = pri int;
type path = string;

The relative path to a filename can be used. Remember, however, that this path will be relative to process.cwd().

module Watch: { ... };
let ftruncateSync: fd => int => unit;
let truncateSync: string => int => unit;
let chownSync: string => uid:int => gid:int => unit;
let fchownSync: fd => uid:int => gid:int => unit;
let readlinkSync: string => string;
let unlinkSync: string => unit;
let rmdirSync: string => unit;
let openSync: path => [ `Read | `Read_write | `Read_write_sync | `Write | `Write_fail_if_exists | `Write_read | `Write_read_fail_if_exists | `Append | `Append_fail_if_exists | `Append_read | `Append_read_fail_if_exists ] => unit;
type encoding = [
  1. | `hex
  2. | `utf8
  3. | `ascii
  4. | `latin1
  5. | `base64
  6. | `ucs2
  7. | `base64
  8. | `binary
  9. | `utf16le
];
let readFileSync: string => encoding => string;
let readFileAsUtf8Sync: string => string;
let existsSync: string => bool;
let writeFileSync: string => string => encoding => unit;
let writeFileAsUtf8Sync: string => string => unit;