njs/fs

Types

pub type Dirent
pub type Encoding {
  Utf8
  Buffer
  Hex
  Base64
  Base64Url
}

Constructors

  • Utf8
  • Buffer
  • Hex
  • Base64
  • Base64Url
pub type FileHandle
pub type FileHandleReadResult {
  FileHandleReadResult(bytes_read: Int, buffer: buffer.Buffer)
}

Constructors

pub type Flag {
  A
  Ax
  Aplus
  Axplus
  As
  Asx
  Asplus
  Asxplus
  R
  Rs
  Rplus
  Rsplus
  Rx
  Rsx
  Rxplus
  Rsxplus
  W
  Ws
  Wx
  Wsx
  Wplus
  Wsplus
  Wxplus
  Wsxplus
}

Constructors

  • A
  • Ax
  • Aplus
  • Axplus
  • As
  • Asx
  • Asplus
  • Asxplus
  • R
  • Rs
  • Rplus
  • Rsplus
  • Rx
  • Rsx
  • Rxplus
  • Rsxplus
  • W
  • Ws
  • Wx
  • Wsx
  • Wplus
  • Wsplus
  • Wxplus
  • Wsxplus
pub type MkdirOptions {
  MkdirOptions(mode: Int)
}

Constructors

  • MkdirOptions(mode: Int)
pub type OpenOptions {
  OpenOptions(mode: Int)
}

Constructors

  • OpenOptions(mode: Int)
pub type ReadFileOptions {
  ReadFileOptions(encoding: Encoding, flag: Flag)
}

Constructors

pub type ReadOptions {
  ReadOptions(encoding: Encoding)
}

Constructors

pub type ReaddirOptions {
  ReaddirOptions(encoding: Encoding, with_file_types: Bool)
}

Constructors

  • ReaddirOptions(encoding: Encoding, with_file_types: Bool)
pub type StatOptions {
  StatOptions(throw_if_no_entry: Bool)
}

Constructors

  • StatOptions(throw_if_no_entry: Bool)
pub type Stats
pub type WriteFileOptions {
  WriteFileOptions(mode: Int, flag: Flag)
}

Constructors

  • WriteFileOptions(mode: Int, flag: Flag)

Values

pub fn access_sync(path: String, mode: Int) -> Nil
pub fn append_file_sync(
  filename: String,
  data: a,
  options: o,
) -> Nil
pub fn close_sync(fd: Int) -> Nil
pub fn constants_f_ok() -> Int
pub fn constants_r_ok() -> Int
pub fn constants_w_ok() -> Int
pub fn constants_x_ok() -> Int
pub fn dirent_is_block_device(dirent: Dirent) -> Bool
pub fn dirent_is_character_device(dirent: Dirent) -> Bool
pub fn dirent_is_directory(dirent: Dirent) -> Bool
pub fn dirent_is_fifo(dirent: Dirent) -> Bool
pub fn dirent_is_file(dirent: Dirent) -> Bool
pub fn dirent_is_socket(dirent: Dirent) -> Bool
pub fn dirent_is_symbolic_link(dirent: Dirent) -> Bool
pub fn dirent_name(dirent: Dirent) -> String
pub fn exists_sync(path: String) -> Bool
pub fn file_handle_close(
  handle: FileHandle,
) -> promise.Promise(Nil)
pub fn file_handle_fd(handle: FileHandle) -> Int
pub fn file_handle_read(
  handle: FileHandle,
  buffer: buffer.Buffer,
  offset: Int,
  length: Int,
  position: a,
) -> promise.Promise(FileHandleReadResult)
pub fn file_handle_stat(
  handle: FileHandle,
) -> promise.Promise(Stats)
pub fn file_handle_write_buffer(
  handle: FileHandle,
  buffer: buffer.Buffer,
  offset: Int,
  length: Int,
  position: a,
) -> promise.Promise(FileHandleReadResult)
pub fn file_handle_write_string(
  handle: FileHandle,
  string: String,
  position: a,
  encoding: String,
) -> promise.Promise(FileHandleReadResult)
pub fn fstat_sync(fd: Int) -> Stats
pub fn lstat_sync(path: String, options: o) -> Stats
pub fn mkdir_sync(path: String, options: o) -> Nil
pub fn open_sync(path: String, flags: String, mode: Int) -> Int
pub fn promises_open(
  path: String,
  flags: String,
  mode: Int,
) -> promise.Promise(FileHandle)
pub fn read_dir_sync(path: String, options: o) -> array.Array(a)
pub fn read_file_sync(filename: String, options: o) -> a
pub fn read_link_sync(path: String, encoding: String) -> a
pub fn read_sync(
  fd: Int,
  buffer: buffer.Buffer,
  offset: Int,
  length: Int,
  position: a,
) -> Int
pub fn real_path_sync(path: String, encoding: String) -> String
pub fn rename_sync(old_path: String, new_path: String) -> Nil
pub fn rmdir_sync(path: String) -> Nil
pub fn stat_sync(path: String, options: o) -> Stats
pub fn stats_atime(stats: Stats) -> String
pub fn stats_atime_ms(stats: Stats) -> Int
pub fn stats_birthtime(stats: Stats) -> String
pub fn stats_birthtime_ms(stats: Stats) -> Int
pub fn stats_blksize(stats: Stats) -> Int
pub fn stats_blocks(stats: Stats) -> Int
pub fn stats_ctime(stats: Stats) -> String
pub fn stats_ctime_ms(stats: Stats) -> Int
pub fn stats_dev(stats: Stats) -> Int
pub fn stats_gid(stats: Stats) -> Int
pub fn stats_ino(stats: Stats) -> Int
pub fn stats_is_block_device(stats: Stats) -> Bool
pub fn stats_is_directory(stats: Stats) -> Bool
pub fn stats_is_fifo(stats: Stats) -> Bool
pub fn stats_is_file(stats: Stats) -> Bool
pub fn stats_is_socket(stats: Stats) -> Bool
pub fn stats_is_symbolic_link(stats: Stats) -> Bool
pub fn stats_mode(stats: Stats) -> Int
pub fn stats_mtime(stats: Stats) -> String
pub fn stats_mtime_ms(stats: Stats) -> Int
pub fn stats_nlink(stats: Stats) -> Int
pub fn stats_rdev(stats: Stats) -> Int
pub fn stats_size(stats: Stats) -> Int
pub fn stats_uid(stats: Stats) -> Int
pub fn symlink_sync(target: String, path: String) -> Nil
pub fn unlink_sync(path: String) -> Nil
pub fn write_file_sync(
  filename: String,
  data: a,
  options: o,
) -> Nil
pub fn write_sync_buffer(
  fd: Int,
  buffer: buffer.Buffer,
  offset: Int,
  length: Int,
  position: a,
) -> Int
pub fn write_sync_string(
  fd: Int,
  string: String,
  position: a,
  encoding: String,
) -> Int
Search Document