fs
- fs
ListDir(path, itemType)⇒Array.<string>ReadFile(path)⇒Uint8ArrayReadFileAsString(path)⇒stringReadFilesFromDir(dir)⇒Array.<string>
(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 fsReturns:
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 fsReturns:
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 fsReturns:
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 fsReturns:
Array.<string> - - The contents of all files in the directory.Throws:
error- The error encountered during reading.
Example