A filesystem, not a bucket
cloud.fs
Paths are absolute from the signed-in user’s own root. Parent directories are created on write, so there is no mkdir dance before saving a file.
Bytes live in Vercel Blob with private access; the tree lives in Redis. Because a blob is addressed by an immutable node id rather than by its path, rename and move never touch the bytes.
Per-user quotas are off by default — a single-user tool does not need one. Set fs.maxBytesPerUser on any deployment that allows anonymous sessions on a public URL, or anyone can mint fresh identities in a loop and fill your store.
Press Run.write(path, data, options?)
Writes a file, creating missing parents. Strings are sent as JSON; a Blob, ArrayBuffer or typed array is sent as a raw body, avoiding base64’s 33% overhead.
read(path) → Blob
The file’s bytes.
readText(path) → string
The file decoded as UTF-8.
readJSON(path) → T
Parses the file as JSON. Throws a bad_request error if it is not valid.
url(path) → string
A URL you can point <img src> or a download link at. The session cookie authorises it, so it works from a same-origin page with no extra work.
mkdir(path)
Creates a directory and any missing parents.
readdir(path = "/") → FsNode[]
Lists a directory, sorted by name. One batched Redis round trip.
stat(path) → FsNode
Metadata for one entry. Throws not_found if it is absent.
exists(path) → boolean
Returns false rather than throwing when the path is missing.
delete(path, { recursive })
Removes a file, or a directory. A non-empty directory needs recursive: true — the blobs of every descendant are reclaimed too.
rename(path, name)
Renames in place. Metadata only: no bytes are copied regardless of how much is inside.
move(path, to)
Moves anywhere in the tree, creating destination parents. Also metadata only. Refuses to move a directory into itself.
copy(path, to)
The one operation that genuinely duplicates bytes. Recurses through directories.
usage()
Bytes and files currently stored, with the ceilings they count against. maxBytes and maxFiles are null when the deployment sets no quota. Check it before a large write if you would rather warn someone than let them lose it.