Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Cabinet

import { Cabinet } from "https://raw.githubusercontent.com/dan-online/cabinet/master/mod.ts";
@example
const file = new Cabinet("./file.txt");
file.read()
class Cabinet {
constructor(file: string);
private lastDecode: {
input: Uint8Array;
type: string;
decoded: string;
}
;
private lastEncode: {
encoded: Uint8Array;
input: string;
}
;
deleter: CabinetDelete;
filePath: string;
mover: CabinetMover;
reader: CabinetRead;
writer: CabinetWrite;
 
decode(input: any, decoding?: string);
delete(cb?: cbErrFile);
encode(input: string);
move(location: string, cb?: (err?: CabinetError) => void);
read(cb?: cbErrFile);
toJSON();
write(data: any, cb?: cbErrFile);
 
static resolve: (...paths: string[]) => string;
}

§Constructors

§
new Cabinet(file: string)
[src]

§Properties

§
lastDecode: {
input: Uint8Array;
type: string;
decoded: string;
}
[src]
§
lastEncode: {
encoded: Uint8Array;
input: string;
}
[src]
§

File deleter

§
filePath: string
[src]

Path to the file

§

File mover

§

File reader

§

File writer

§Methods

§
decode(input: any, decoding?: string)
[src]

Decode Uint8Array with optional decoding

§
delete(cb?: cbErrFile)
[src]

Delete the file with an optional callback

§
encode(input: string)
[src]

Encode text to UintArray

§
move(location: string, cb?: (err?: CabinetError) => void)
[src]

Move the file with an optional callback

§
read(cb?: cbErrFile)
[src]

Read the file with an optional callback

§
toJSON()
[src]
§
write(data: any, cb?: cbErrFile)
[src]

Write to the file with an optional callback

§Static Properties

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