Skip to Content
🚀 Legit SDK Alpha preview – help shape it on Discord here.
DocumentationAPILegit SDK API

Legit SDK API Reference

Initialize a versioned filesystem.

initLegitFs(fs: FsLike, rootPath: string): Promise<LegitFS>

Parameters

  • fs – any Node.js-style filesystem implementing promises (e.g., memfs, fs)
  • rootPath – root path for your filesystem

Returns

  • Promise<LegitFS> – a versioned filesystem instance

Example

import { fs } from 'memfs' import { initLegitFs } from '@legit-sdk/core' const legitFs = await initLegitFs(fs, '/')

Notes:

  • Use this to start a new repo
  • All filesystem operations afterward go through the returned Legit FS
Last updated on