Namespace: codemelted_disk

codemelted_disk

Provides the ability to manage items on disk. This includes file manipulation, reading / writing files, and opening files for additional work. Only supported on the Deno runtime and will throw a SyntaxError if attempting to run within a Web Browser.
Source:

Members

(static, readonly) pathSeparator :string

Identifies the path separator for files on disk.
Type:
  • string
Source:

(static, readonly, nullable) tempPath :string

Identifies the temp directory on disk. Null is returned if on web browser.
Type:
  • string
Source:

Methods

(static) cp(params) → {boolean}

Copies a file / directory from its currently source location to the specified destination.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
src string The source item to copy.
dest string The destination of where to copy the item.
Source:
Returns:
true if carried out, false otherwise.
Type
boolean

(static) ls(params) → (nullable) {Array.<CFileInfo>}

List the files in the specified source location.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
path string The path to list.
Source:
Returns:
Array of files found.
Type
Array.<CFileInfo>

(static) mkdir(params) → {boolean}

Makes a directory at the specified location.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
path string The source item to create.
Source:
Returns:
Type
boolean

(static) readFile(params) → {string|Uint8Array|null}

Reads a file to disk.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
filename string The filename to write.
isTextFile boolean true if text file, false if binary.
Source:
Returns:
Type
string | Uint8Array | null

(static) rm(params) → {boolean}

Removes a file or directory at the specified location.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
path string The source item to create.
Source:
Returns:
Type
boolean

(static) writeFile(params) → {boolean}

Writes a file to disk.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
filename string The filename to write.
data string | Uint8Array The data to write.
append boolean true to append the data, false to overwrite the file.
Source:
Returns:
true if successful, false otherwise.
Type
boolean