Skip to content

fs

Vara's library for managing the file system.

const fs = require("@vara/fs")

local source = buffer.fromstring("hello guys")
const path = "example.txt"

fs.Write(path,source)

local fileContents = fs.Read(path)
print(fileContents)

functions

Write -> ()

fs.Write(
    path: string, 
    contents: buffer | string
): ()
Writes contents into the file that path points to.

Read -> buffer

fs.Read(path: string): buffer
Reads the file contents of the file thats path points to.

File -> File

fs.File(path: string): File
Creates a file object from a path string.

Directory -> Directory

fs.Directory(path: string): Directory
Creates a directory object from a path string.