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

CabinetWrite

import { CabinetWrite } from "https://raw.githubusercontent.com/dan-online/cabinet/master/src/handlers/Write.ts";
@example
const { writer } = new Cabinet("./file.txt");
writer.sync("Hello!")
class CabinetWrite {
constructor(fs: Cabinet);
private fs: Cabinet;
filePath: string;
 
callback(data: any, cb: cbErrFile);
encode(data: any);
promise(data: any);
sync(data: any);
write(data:
| Uint8Array
| string
| object
| any
, callback?: cbErrFile);
}

§Constructors

§
new CabinetWrite(fs: Cabinet)
[src]

§Properties

§
filePath: string
[src]

Path to the file

§Methods

§
callback(data: any, cb: cbErrFile)
[src]

Write to the file and receive a callback

§
encode(data: any)
[src]

Encode the file to Uint8Array

§
promise(data: any)
[src]

Write to the file and receive a promise

§
sync(data: any)
[src]

Synchronously write to a file

§
write(data: Uint8Array | string | object | any, callback?: cbErrFile)
[src]

Write to the file with an optional callback