File operations
One client for create, update, and delete.
Walk a file through its full lifecycle with a single TypeScript SDK. Open a flow on the left to load the matching snippet.
Write a new object with a path, mime type, and body. The client returns a durable id you can pass to later calls.
Patch the path or body in place. Each write bumps a revision so you can audit what changed.
Remove an object with a reason code. Set purge when the bytes should leave the vault immediately.
create-file.ts
TypeScript
import { Files } from "@northline/storage";
const files = new Files({ token: process.env.NORTHLINE_TOKEN });
const created = await files.create({
path: "briefs/q3-launch.md",
mime: "text/markdown",
body: "# Q3 launch\nDraft the customer email first.",
});
console.log(created.id);