Skip to main content

fs

(fs).ListDir(path, itemType) ⇒ Array.<string>

ListDir lists all files and directories within a path depending on the itemType provided. itemType can be any one of [‘file’,‘dir’,‘all’] Kind: inner method of fs
Returns: Array.<string> - - The list of files and directories.
Throws:
  • error - The error encountered during listing.
Example

(fs).ReadFile(path) ⇒ Uint8Array

ReadFile reads file contents within permitted paths Kind: inner method of fs
Returns: Uint8Array - - The contents of the file.
Throws:
  • error - The error encountered during reading.
Example

(fs).ReadFileAsString(path) ⇒ string

ReadFileAsString reads file contents within permitted paths and returns content as string Kind: inner method of fs
Returns: string - - The contents of the file as a string.
Throws:
  • error - The error encountered during reading.
Example

(fs).ReadFilesFromDir(dir) ⇒ Array.<string>

ReadFilesFromDir reads all files from a directory and returns a array with file contents of all files Kind: inner method of fs
Returns: Array.<string> - - The contents of all files in the directory.
Throws:
  • error - The error encountered during reading.
Example