{"_id":"@bspeckco/tinysynq-node","_rev":"8-7e616426826077691f06492506be5452","name":"@bspeckco/tinysynq-node","dist-tags":{"latest":"0.2.7"},"versions":{"0.2.1":{"name":"@bspeckco/tinysynq-node","version":"0.2.1","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.1","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"87fe8295da2628405df3234ba78d174f2efd775e","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.1.tgz","fileCount":54,"integrity":"sha512-nG4LES2qwwV/n0b9W5JDA5wmXMSZ97Adac2fJY1Y8YexhA8YUW/CqCYHjsPd4MkV2UWX5uj7csIwq49W1bpVRQ==","signatures":[{"sig":"MEUCIGtly8vcCNIcNQiJwn3aoKDL8Y5nagtTxBbBqckjMx1PAiEAj7D5C4PCGihyAKisSwn7O38XORGUrkPCtE6iLVk9+lE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278632},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"b690694eea49559cc98fabf28638fe14e6188d69","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"10.9.2","description":"To install dependencies:","directories":{},"_nodeVersion":"22.17.1","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.52.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.1_1762065556705_0.7798583761453102","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@bspeckco/tinysynq-node","version":"0.2.2","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.2","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"a6d2fca7c14a86713eae6d4392a4ede4aa56bf9a","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.2.tgz","fileCount":54,"integrity":"sha512-xb9eH/dYkHa7JJVRactGm1OVH8y2MWDZHLCBiKiwaO1VbbQWaAsCfcyEcAuy0cXwiFAApt/sM5rAHAKp5Ypgng==","signatures":[{"sig":"MEQCIH8IoSHZO45K7pJBvduuk22yuslLgDfHEwdvQA2B0pf4AiALkee3tnoT1zYJEKyLTzXbaKOMw7tUPac90I5xalE6tQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278718},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"84b42057731f63b42ba1a23148e96095bb3a358e","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"10.9.2","description":"To install dependencies:","directories":{},"_nodeVersion":"22.17.1","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.52.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.2_1762066313393_0.5103526790904191","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@bspeckco/tinysynq-node","version":"0.2.3","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.3","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"ae134a2b4b5f5309e5dfd7abea354d2ecae19ae4","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.3.tgz","fileCount":73,"integrity":"sha512-NPUlVlebvRWwE5HRU6SwDSvPXUWhzS1hdRlibrYv7Lk9KxAGerkOygDgZjFArthjhr4X4Ect4NFVf1SPjSL+8A==","signatures":[{"sig":"MEUCIQC2HvDHl1o2Gex8wrFeaNPspS2bm0RDbrWa8cXg46fR6QIgBVWRNAE/JcoddnsuL7n8Nu+puJWbavMuq1F5qHKcIj4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293195},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"33643c921a10481e47bec37052a12b51d56a1040","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"10.9.2","description":"To install dependencies:","directories":{},"_nodeVersion":"22.17.1","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.52.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.3_1762066897449_0.852260028777083","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@bspeckco/tinysynq-node","version":"0.2.4","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.4","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"00413ebe45230751deb07fa927166793e0d427e6","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.4.tgz","fileCount":73,"integrity":"sha512-DnP/QJTfbqvyMCYAQB0TH7T5mUrKGgRxsV0AZMA2hYM+nS12qcrjiVUZa8jMR01j4fQQOUqW3D8+jYd3jJoAtw==","signatures":[{"sig":"MEUCIQDszzoydJZUNOVEFyAPfCLgWDwt8dstO54hXcJsM1LVkwIgO4bFUmCT/xMR1JZN3mOC9+c7pMN6s+ylEQOoszHv34A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":298845},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"5ee0be095e54c26e5de26182c769cf27690526ac","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"9.8.1","description":"Node.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).   The package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes an optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.43.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.4_1762073687822_0.27597215033758915","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@bspeckco/tinysynq-node","version":"0.2.5","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.5","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"6f33acd48c5f72adea3844c5e2b519ec8631f89d","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.5.tgz","fileCount":73,"integrity":"sha512-k48/bnxUdx6pP3UsfJ2fcTs+sprXarsTMcamUgHu+hoHDHVCFNPPO4yXF/m2/TOqOKLEnX9zYenrqP3DZZhY9w==","signatures":[{"sig":"MEUCIFzbfK5LOphHfJAav8SOj67m05cpRmBOdrmG8PV/QC8pAiEAhJe+sLZ3rIReW61wOZ8hbu2hM2buHYyJO7GmoOxc6Zo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":301379},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"be8efae365d4ed322847bc1a9aca26399122c486","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"9.8.1","description":"Node.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).   The package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes an optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.43.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.5_1762683293230_0.9929052242354768","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@bspeckco/tinysynq-node","version":"0.2.6","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.6","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"78a427ae01ed484b99088b1b0d021ae1fef5c7ed","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.6.tgz","fileCount":73,"integrity":"sha512-lej2YJD+rjJPwZJODJ5p7In+7snaEwy/PsToTbe9VwRFjfgn3rTznZVtUqRSaHfKQrAPQNMk3HExDp/FpD5B/w==","signatures":[{"sig":"MEQCICuc5bcLOlhPz6ePsfBPjkzWApxuU4N6+GonrwtZPqwkAiBgv/S2doHMQ/++A279jZszCXU6rZMQ9NDZqIXNlBE07Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310242},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"1106f7d63283b461f97e17a6452661eea6d4a952","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"9.8.1","description":"Node.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).   The package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes an optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.43.0","@bspeckco/tinysynq-lib":"2.5.1"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.6_1762694338512_0.49472174967326144","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"name":"@bspeckco/tinysynq-node","version":"0.2.7","license":"MIT","_id":"@bspeckco/tinysynq-node@0.2.7","maintainers":[{"name":"bspeckco","email":"admin.n@bluespeck.co"}],"dist":{"shasum":"eeee926870247d746ea12470669bffacb4e5932f","tarball":"https://registry.npmjs.org/@bspeckco/tinysynq-node/-/tinysynq-node-0.2.7.tgz","fileCount":73,"integrity":"sha512-uNmY7Ri06oMHr68BI8SfGb2nw1szVsNX2ZQWRXF5JotdN+LaA9yF/A7lQqNs4QJjLNlB8kuxik2hTtoDRyE2Bg==","signatures":[{"sig":"MEUCIQD6ZE62Sm9vGZvl6auVa2g30sVloONA1eilTDfpuEyr3gIgGwLB7OYMBiS8XTiQbogP2jsHXQbLFIX0NQ5wQuFAZ48=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310242},"main":"./dist/tinysynq.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/tinysynq.umd.js","module":"./dist/tinysynq.module.js","source":"src/index.ts","engines":{"node":">=18.18.2"},"exports":{"types":"./dist/index.d.ts","default":"./dist/tinysynq.modern.js","require":"./dist/tinysynq.cjs"},"gitHead":"c9399109884e03d53c1c7bb976c4b02dc2cfc3e9","scripts":{"docs":"api-extractor run --local --verbose && api-documenter markdown --input-folder temp --output-folder docs","test":"vitest --run","build":"microbundle --target node","watch":"microbundle --target node watch","prepare":"if [ -z \"$SKIP_PREPARE\" ]; then echo $SKIP_PREPARE; echo '@prepare'; husky; fi","commitlint":"commitlint --config ./config/commitlint.config.js --edit $1"},"_npmUser":{"name":"bspeckco","email":"admin.n@bluespeck.co"},"_npmVersion":"9.8.1","description":"Node.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).   The package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes an optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"^4.9.3","dotenv":"^16.4.5","nanoid":"^5.0.5","date-fns":"^3.3.1","better-sqlite3":"^12.4.1","uWebSockets.js":"github:uNetworking/uWebSockets.js#v20.43.0","@bspeckco/tinysynq-lib":"2.5.2"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.18.1","vite":"^5.1.3","husky":"^9.0.11","vitest":"^1.2.2","@types/ws":"^8.5.10","@types/bun":"latest","typescript":"^5.0.0","microbundle":"^0.15.1","@commitlint/cli":"^18.6.1","standard-version":"^9.5.0","@types/better-sqlite3":"^7.6.9","@microsoft/api-extractor":"^7.42.3","@microsoft/api-documenter":"^7.23.37","@commitlint/config-conventional":"^18.6.2"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tinysynq-node_0.2.7_1762699309535_0.7929639475304053","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-11-02T06:39:16.619Z","modified":"2026-02-18T12:37:35.579Z","0.2.1":"2025-11-02T06:39:16.894Z","0.2.2":"2025-11-02T06:51:53.573Z","0.2.3":"2025-11-02T07:01:37.709Z","0.2.4":"2025-11-02T08:54:47.999Z","0.2.5":"2025-11-09T10:14:53.456Z","0.2.6":"2025-11-09T13:18:58.716Z","0.2.7":"2025-11-09T14:41:49.780Z"},"license":"MIT","description":"Node.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).   The package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes an optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull","maintainers":[{"email":"admin.n@bluespeck.co","name":"lnoir"}],"readme":"# tinysynq-node\n\nNode.js host utilities for [TinySynq](https://github.com/bspeckco/tinysynq).  \nThe package bootstraps SQLite change tracking (via `@bspeckco/tinysynq-lib`) and exposes\nan optional WebSocket hub powered by `uWebSockets.js` so TinySynq clients can push/pull\nchanges.\n\n- `initTinySynq` configures a `TinySynqSync` instance backed by `better-sqlite3`.\n- `startTinySynqServer` starts a WebSocket hub that serves TinySynq clients.\n\n## Prerequisites\n\n- Node.js ≥ 18.18.2\n- SQLite ≥ 3.45.1 (required by `better-sqlite3@^12`)\n- Build tooling needed by `better-sqlite3` (Brew/XCode CLT on macOS, `build-essential` on Linux, MSVC on Windows)\n- Existing tables for every sync target (create them up front or via `preInit`)\n\n## Installation\n\n```bash\npnpm add @bspeckco/tinysynq-node\n# optional if you want to control the driver version yourself\npnpm add better-sqlite3\n```\n\n`tinysynq-node` auto-loads `.env` files through `dotenv`. Place a `.env` file next to\nyour entry point or export `TINYSYNQ_*` variables in your shell.\n\n## Quick Start\n\nCreate the tables you want to synchronise, then wire everything together:\n\n```ts\n// sync-server.ts\nimport { resolve } from 'node:path';\nimport { initTinySynq, startTinySynqServer } from '@bspeckco/tinysynq-node';\n\nconst ts = initTinySynq({\n  filePath: resolve('app.db'),\n  prefix: 'app', // internal tables use this prefix\n  tables: [\n    {\n      name: 'todos',\n      id: 'todo_id',\n      editable: ['title', 'is_done'],\n    },\n  ],\n  preInit: [\n    `CREATE TABLE IF NOT EXISTS todos (\n       todo_id TEXT PRIMARY KEY,\n       title TEXT NOT NULL,\n       is_done INTEGER DEFAULT 0,\n       updated_at TEXT DEFAULT (STRFTIME('%Y-%m-%dT%H:%M:%f','now'))\n     );`,\n  ],\n  logOptions: { type: 'pretty', minLevel: 3 },\n});\n\nconst server = startTinySynqServer({\n  ts,\n  port: 7174, // defaults to process.env.TINYSYNQ_WS_PORT || 7174\n  logOptions: { type: 'pretty', minLevel: 3 },\n  auth: async (req) => {\n    const token = req.getHeader('authorization');\n    return token === process.env.SYNC_TOKEN; // true to authorise, false to reject\n  },\n  telemetry: {\n    emit: (event) => console.log('[tinysynq]', event),\n  },\n});\n\nprocess.on('SIGTERM', () => server.close());\nprocess.on('SIGINT', () => server.close());\n```\n\nRun the hub:\n\n```bash\nnode --loader ts-node/esm sync-server.ts   # or compile first then run\n```\n\nPoint a TinySynq client (`@bspeckco/tinysynq-web`, `@bspeckco/tinysynq-tauri`, etc.)\nat `ws://localhost:7174`.\n\n## Using an existing `better-sqlite3` instance\n\nIf your app already manages the database connection, pass it in via `sqlite3`:\n\n```ts\nimport Database from 'better-sqlite3';\nimport { initTinySynq } from '@bspeckco/tinysynq-node';\n\nconst db = new Database(':memory:');\n\nconst ts = initTinySynq({\n  sqlite3: db,\n  prefix: 'app',\n  tables: [\n    { name: 'todos', id: 'todo_id', editable: ['title', 'is_done'] },\n  ],\n  wal: true, // enabled by default; set to false if WAL can't be used\n});\n```\n\nYou can also supply your own adapter via `adapter` when integrating with\nnon-`better-sqlite3` drivers.\n\n## API reference\n\n```ts\nimport {\n  initTinySynq,\n  startTinySynqServer,\n  TinySynq,\n  type TinySynqOptions,\n  type SyncableTable,\n  type TSServerParams,\n  type TinySynqServerControl,\n  type TSSocketRequestParams,\n  type SocketRequestType,\n} from '@bspeckco/tinysynq-node';\n```\n\n### `initTinySynq(options: TinySynqOptions)`\n\nRequired options:\n- `prefix`: string prefix for TinySynq metadata tables (trailing `_` removed)\n- `tables`: array of `{ name, id, editable }` describing sync targets\n- One of `filePath`, `sqlite3`, or `adapter`\n\nUseful optional settings:\n- `preInit`/`postInit`: SQL executed before/after triggers are installed\n- `debug`: write change dumps to `{table}_dump` tables\n- `logOptions`: forwarded to [`tslog`](https://tslog.js.org/#/?id=settings)\n- `wal`: toggle WAL mode (defaults to `true`)\n- `batchSize`: max records per pull round\n- `telemetry`: `{ emit(event) }` hook for lifecycle events\n\nReturns the configured `TinySynq` instance.\n\n### `startTinySynqServer(params: TSServerParams)`\n\nParameters:\n- `ts` (**required**): TinySynq instance returned from `initTinySynq`\n- `logOptions` (**required**): same shape as `tslog` settings\n- `port`: overrides the default port (falls back to `TINYSYNQ_WS_PORT || 7174`)\n- `auth(req)`: async guard executed during WebSocket upgrade. Return `true`, `false`, or an object to merge into the connection's user data.\n- `telemetry`: emit structured events for connection/push/pull lifecycle.\n\nReturns `{ app, close }`. Call `close()` to stop listening.\n\n### Types\n\nThe package re-exports the most useful types directly:\n\n- `SyncableTable`, `TinySynqOptions`, `Change`, `QueryParams` (from the core lib)\n- `TSServerParams`, `TSSocketRequestParams`, `TinySynqServerControl`, `SocketRequestType`\n- `BetterSqlite3Instance`, `TinySynq`\n\n## Environment variables\n\n| Variable              | Purpose                                        | Default |\n| --------------------- | ---------------------------------------------- | ------- |\n| `TINYSYNQ_WS_PORT`    | WebSocket port for the hub                     | `7174`  |\n| `TINYSYNQ_LOG_LEVEL`  | Numeric [`tslog` level](https://tslog.js.org)  | `info`  |\n| `TINYSYNQ_LOG_FORMAT` | `json`, `pretty`, or `hidden`                  | `json`  |\n\n`TINYSYNQ_WS_HOST`, `TINYSYNQ_HTTP_HOST`, and `TINYSYNQ_HTTP_PORT` are loaded for consistency with other packages but unused in this module.\n\n## Development scripts\n\n```bash\npnpm i\npnpm test\npnpm build\npnpm watch\n```\n\nSet `SKIP_PREPARE=1` if you do not want Husky hooks to run during install.\n\n## Related packages\n\n- [`@bspeckco/tinysynq-lib`](../tinysynq-lib) – core change-tracking engine\n- [`@bspeckco/tinysynq-web`](../tinysynq-web) – browser/WebSocket client\n- [`@bspeckco/tinysynq-tauri`](../tinysynq-tauri) – Tauri desktop client\n","readmeFilename":"README.md"}