Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/smx/src/modules/infra/file-handler.ts>FileHandler

Manage and sync scripts, configs and templates between computers
Latest
class FileHandler
implements IFileHandler
import { FileHandler } from "https://deno.land/x/smx@v0.6.0/src/modules/infra/file-handler.ts";

Constructors

new
FileHandler(path: string, type?: "file" | "folder")

Properties

protected
_folder: string
protected
_path: string
readonly
path: string

Methods

private
getPathPair(path: string, type: "file" | "folder"): [string, string]
readJsonFile<T>(defaultValue: T): Promise<T>
readTextFile(defaultValue?): Promise<string>
writeJsonFile<T>(content: T): Promise<boolean>
writeTextFile(content: string): Promise<boolean>

Static Properties

create: (path: string) => IFileHandler