Skip to content
Français

createLocalTransport

import { createLocalTransport } from "@elie-laloum/outpost";

Create a transport that stores each key as one owner-only file under <directory>/objects, created on first write. Per-key lock files serialize mutations between processes on one machine; a mutation that waits more than 30000 ms for its lock rejects. It provides no distributed ownership over NFS or other shared mounts.

Complete example and detailed rules.

  • optionsRequired
    LocalTransportOptions
    Directory that holds the objects and their lock files.
  • options.directoryRequired
    string
    Root directory, resolved when the factory is called; objects go under objects/ and locks under .outpost/locks. A symlinked root rejects the first write.

Transport

export declare function createLocalTransport(
  options: LocalTransportOptions,
): Transport;