Skip to main content
Module

x/cabinet/mod.ts>Cabinet

Cabinet, the easier way to manage files in Deno
Latest
class Cabinet
Re-export
import { Cabinet } from "https://deno.land/x/cabinet@v1.1.1/mod.ts";

Examples

Example 1

const file = new Cabinet("./file.txt");
file.read()

Constructors

new
Cabinet(file: string)

Properties

private
lastDecode: { input: Uint8Array; type: string; decoded: string; }
private
lastEncode: { encoded: Uint8Array; input: string; }
deleter: CabinetDelete

File deleter

filePath: string

Path to the file

File mover

reader: CabinetRead

File reader

writer: CabinetWrite

File writer

Methods

decode(input: any, decoding?: string)

Decode Uint8Array with optional decoding

Delete the file with an optional callback

encode(input: string)

Encode text to UintArray

move(location: string, cb?: (err?: CabinetError) => void)

Move the file with an optional callback

Read the file with an optional callback

write(data: any, cb?: cbErrFile)

Write to the file with an optional callback

Static Properties

resolve: (...paths: string[]) => string