@mblaney/holster
v2.1.3
Published
Holster is a service that allows synchronising data between devices using Node, Deno, Bun or the browser.
Readme
Holster is a real-time data synchronisation service that connects devices using Node.js, Deno, Bun or the browser. Built with ES modules, it features end-to-end encryption, conflict resolution and cross-platform compatibility.
✨ Real-time sync across all connected devices
🔐 Built-in encryption with user authentication
⚡ Zero configuration with smart performance optimisation
🌐 Universal compatibility - works everywhere JavaScript runs
Try it out at holster.haza.website!
A build version of Holster is also provided using esbuild, to run in production.
Check out the Github Wiki for how to get started using the API, and for more information.
Quick Start
- Clone this repo
Then using Docker
- Run
docker build -t holster .to build the image - Run
docker run -p 3000:3000 -p 8765:8765 holsterto start the server
Or run locally
- Run
npm install - Run the server with
node src/index.js
Once the server is running
- Open
http://localhost:3000/examples/index.htmlin the browser. - You will then also have access to the Holster API via the
holsterobject in the console
How to run a Holster relay
To run a Holster relay, create a relay.js file with:
import Holster from "@mblaney/holster/src/holster.js"
Holster({port: 8765})That's all you need to run a server on port 8765. You may also want to pass in
memory and storage options with larger values than the defaults, which are
conservative to support browser use. See Holster options for more details. To run this
with node:
npm installnode relay.js
For production you can start with pm2:
npm install pm2 -gexport NODE_ENV=productionpm2 startup(And follow startup instructions.)pm2 start relay.jspm2 save
To allow connections via a web server see examples/apache.md.
Related packages
holster-router provides an Express router for building web applications with Holster, including user account management and email integration.
Development
- When modifying files run:
npx prettier . --write - To run the JavaScript tests use:
npm run test - To run the TypeScript tests use:
npm run test:ts
