bungibindies/bun/bunfile
A BunFile
represents a lazily-loaded file; initializing it does not actually read the file from disk.
Note from Bun — The
Bun.file
andBun.write
APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available withBun.file
, such asmkdir
orreaddir
, you can use Bun’s nearly complete implementation of thenode:fs
module.
Types
Constants
pub const unlink: fn(BunFile) -> Promise(Nil)
Functions
pub fn delete(file: BunFile) -> Promise(Nil)
pub fn json(file: BunFile) -> Promise(Dynamic)
pub fn text(file: BunFile) -> Promise(String)