makeAdapter
makeAdapter(
__namedParameters):Adapter
Defined in: adapter.ts:128
Creates a single-threaded LiveStore adapter for Node.js applications.
This adapter runs the leader thread (persistence and sync) in the same thread as your application. Suitable for CLI tools, scripts, and applications where simplicity is preferred over maximum performance.
For production servers or performance-critical applications, consider makeWorkerAdapter
which runs persistence/sync in a separate worker thread.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”NodeAdapterOptions & object
Returns
Section titled “Returns”Adapter
Examples
Section titled “Examples”import { makeAdapter } from '@livestore/adapter-node'import { makeWsSync } from '@livestore/sync-cf/client'
const adapter = makeAdapter({ storage: { type: 'fs', baseDirectory: './data' }, sync: { backend: makeWsSync({ url: 'wss://api.example.com/sync' }), },})// With DevTools supportconst adapter = makeAdapter({ storage: { type: 'fs', baseDirectory: './data' }, devtools: { schemaPath: new URL('./schema.ts', import.meta.url), port: 4242, },})https://livestore.dev/docs/reference/adapters/node for setup guide