
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@domstack/sync
Advanced tools
A modern, minimal live-reload dev server. A love letter to browser-sync, rewritten from scratch: ESM-only, Fastify, native WebSocket, server-rendered HTMX UI panel.
npm install @domstack/sync
# Serve current directory, watch CSS and HTML
domstack-sync --server . --files '**/*.css' '**/*.html'
# Watch files without serving (snippet-injection mode)
domstack-sync --files '**/*.css'
# Short alias
dss --server . --files '**/*'
# Disable the UI panel
domstack-sync --server . --no-ui
# Write a starter config file
domstack-sync init
# Trigger a reload from another terminal
domstack-sync reload --port 3000
| Flag | Default | Description |
|---|---|---|
--server, -s | — | Directory to serve |
--files, -f | — | Glob patterns to watch (repeatable) |
--port | 3000 | Port to listen on |
--no-ui | — | Disable the UI panel |
--no-notify | — | Disable the notification overlay |
--no-ghost-mode | — | Disable scroll/click/form sync |
--cors | — | Enable CORS headers |
--log-level | info | silent | info | debug |
--help, -h | — | Show help text |
--version, -v | — | Show version |
import { createServer, parseOptions } from '@domstack/sync'
const bs = await createServer({
server: './public',
files: ['public/**/*.css', 'public/**/*.html'],
port: 3000,
})
console.log(bs.url) // http://localhost:3000
console.log(bs.uiUrl) // http://localhost:3001
// Trigger a full reload
bs.reload()
// CSS-inject a specific file (falls back to full reload if not matched)
bs.reload(['styles/main.css'])
// Show a notification overlay in connected browsers
bs.notify('Build complete')
// Stream integration — pipe any { path } objects through to trigger reloads
someReadableStream.pipe(bs.stream())
// Listen for server-side events
bs.events.on('client:connect', (info) => console.log('connected', info.ua))
bs.events.on('client:disconnect', (id) => console.log('disconnected', id))
bs.events.on('file:change', (evt) => console.log('changed', evt.path))
// Pause / resume watcher-triggered reloads (e.g. during a build)
bs.pause()
bs.resume()
// Graceful shutdown
await bs.exit()
| Option | Type | Default | Description |
|---|---|---|---|
port | number | 3000 | Port to listen on (falls back to OS-assigned if taken) |
server | string | false | false | Directory to serve statically |
files | string[] | [] | Glob patterns to watch for changes |
ghostMode | { scroll, clicks, forms } | all true | Sync interactions across connected browsers |
logLevel | 'silent' | 'info' | 'debug' | 'info' | Log verbosity |
ui | boolean | { port: number } | true | UI panel — false disables, { port } pins the port |
notify | boolean | true | Show notification overlay in connected browsers |
cors | boolean | false | Add CORS headers to all responses |
injectChanges | boolean | true | CSS-inject .css changes instead of full reload |
reloadDebounce | number | 500 | Milliseconds to debounce file-change reloads |
reloadDelay | number | 0 | Milliseconds to delay reload after a change |
watchOptions | object | {} | Options passed through to chokidar |
cwd | string | process.cwd() | Working directory for resolving server and files |
All types are exported:
import type { BsInstance, BsOptions, BsOptionsInput } from '@domstack/sync'
import type { ServerToClientMessage, ClientToServerMessage } from '@domstack/sync'
<script> tag is injected before </body> (or appended if there is no </body>) in every HTML response. The injected script connects to the WebSocket server..css file changes and injectChanges: true, the matching <link rel="stylesheet"> has its href cache-busted in place without a full page reload. Falls back to a full reload if no matching stylesheet is found.ghostMode: false or --no-ghost-mode.ui: false or --no-ui.MIT
FAQs
A modern, minimal live-reload dev server
The npm package @domstack/sync receives a total of 295 weekly downloads. As such, @domstack/sync popularity was classified as not popular.
We found that @domstack/sync 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.