UNPKG

tav-media

Version:

Cross platform media editing framework

32 lines (31 loc) 843 B
import { tav } from '../tav'; /** * Utils for file reading and writing files. * @hideconstructor */ export class File { /** * Read the string content of a file. * @param path The path of the file. * @returns The content of the file. */ static readText(path) { return tav.File.readText(path); } /** * Write a string to a file. * @param content The string content to write. * @param path The path of the file. */ static writeText(content, path) { return tav.File.writeText(content, path); } /** * Unzip a zip file to specified path. * @param zipPath The path of the zip file. * @param resultPath The directory to extract the zip file. */ static unzip(zipPath, resultPath) { return tav.File.unzip(zipPath, resultPath); } }