You can easily access your files in different formats (text, json, stream, etc...).
import { f0 } from"file0";import { Readable } from"stream";import fs from"fs";// Get file metadata (name, size, public url, etc..)constmetadata=awaitf0.get("logs.txt");// Download a text fileconsttext=awaitf0.get("hello.txt", { as:"text" });// Download a json objectconstobj=awaitf0.get("data.json", { as:"json" });// Download as a stream and save to the file systemconstfileStream=awaitf0.get("logs.txt", { as:"stream"});Readable.fromWeb(fileStream).pipe(fs.createWriteStream("./logs.txt"));// Download as a bufferconstfile=awaitf0.get("image.png", { as:"buffer" });// returns the web-compatible ArrayBuffer// To convert it to a Node.js Buffer:constnodejsBuffer=Buffer.from(file);