
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
@durable-streams/server
Advanced tools
Node.js reference server implementation for the Durable Streams protocol.
npm install @durable-streams/server
This package provides a reference implementation of the Durable Streams protocol for Node.js. It supports both in-memory and file-backed storage modes, making it suitable for development, testing, and production workloads.
For a standalone binary option, see the Caddy-based server.
import { DurableStreamTestServer } from "@durable-streams/server"
const server = new DurableStreamTestServer({
port: 4437,
host: "127.0.0.1",
})
await server.start()
console.log("Server running on http://127.0.0.1:4437")
Fast, ephemeral storage for development and testing:
import { DurableStreamTestServer, StreamStore } from "@durable-streams/server"
const store = new StreamStore()
const server = new DurableStreamTestServer({
port: 4437,
store,
})
Persistent storage with streams stored as log files and LMDB for metadata:
import {
DurableStreamTestServer,
FileBackedStreamStore,
} from "@durable-streams/server"
const store = new FileBackedStreamStore({
path: "./data/streams",
})
const server = new DurableStreamTestServer({
port: 4437,
store,
})
Track stream lifecycle events (creation, deletion):
import {
DurableStreamTestServer,
createRegistryHooks,
} from "@durable-streams/server"
const server = new DurableStreamTestServer({
port: 4437,
hooks: createRegistryHooks({
registryPath: "__registry__",
}),
})
The registry maintains a system stream that tracks all stream creates and deletes, useful for building admin UIs or monitoring.
interface TestServerOptions {
port?: number
host?: string
store?: StreamStore | FileBackedStreamStore
hooks?: StreamLifecycleHook[]
cors?: boolean
cursorOptions?: CursorOptions
}
class DurableStreamTestServer {
constructor(options?: TestServerOptions)
start(): Promise<void>
stop(): Promise<void>
readonly port: number
readonly baseUrl: string
}
In-memory stream storage:
class StreamStore {
create(path: string, contentType: string, options?: CreateOptions): Stream
get(path: string): Stream | undefined
delete(path: string): boolean
append(path: string, data: Uint8Array, seq?: string): void
read(path: string, offset: string): ReadResult
}
File-backed persistent storage (log files for streams, LMDB for metadata) with the same interface as StreamStore.
export { DurableStreamTestServer } from "./server"
export { StreamStore } from "./store"
export { FileBackedStreamStore } from "./file-store"
export { encodeStreamPath, decodeStreamPath } from "./path-encoding"
export { createRegistryHooks } from "./registry-hook"
export {
calculateCursor,
handleCursorCollision,
generateResponseCursor,
DEFAULT_CURSOR_EPOCH,
DEFAULT_CURSOR_INTERVAL_SECONDS,
type CursorOptions,
} from "./cursor"
export type {
Stream,
StreamMessage,
TestServerOptions,
PendingLongPoll,
StreamLifecycleEvent,
StreamLifecycleHook,
} from "./types"
Use the conformance test suite to validate protocol compliance:
import { runConformanceTests } from "@durable-streams/server-conformance-tests"
runConformanceTests({
baseUrl: "http://localhost:4437",
})
Apache-2.0
FAQs
Node.js reference server implementation for Durable Streams
We found that @durable-streams/server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.