An open API service indexing awesome lists of open source software.

https://github.com/dinoscapeprogramming/syncstore

A lightweight, auto-saving JSON store using Proxy in Node.js.
https://github.com/dinoscapeprogramming/syncstore

Last synced: 3 months ago
JSON representation

A lightweight, auto-saving JSON store using Proxy in Node.js.

Awesome Lists containing this project

README

          

# SyncStore

**SyncStore** is a minimalist, zero-dependency JSON store for Node.js that automatically syncs changes to disk using JavaScript's Proxy. Perfect for prototyping, small tools, and local data persistence.

## 🚀 Features

- 🔁 Auto-saves to file on every change
- ⚡ In-memory caching for fast access
- 🪞 Fully proxied — just use it like a normal object
- 🧩 Zero dependencies

## 📦 Installation

```bash
npm install syncstore.json
```

## 🛠️ Usage

```js
const SyncStore = require("syncstore.json");
const db = new SyncStore("./data.json");

// Use it like a regular object
db.username = "Alice";
db.settings = { darkMode: true };
delete db.username;

console.log(db.settings.darkMode); // true
```

All changes are saved immediately to `data.json`.

## 📁 File Format

The backing file is standard JSON:

```json
{
"settings": {
"darkMode": true
}
}
```

## ✅ Use Cases

* CLI tools
* Quick local apps
* Prototyping databases
* Config or settings storage

## 📜 License

MIT © DinoscapeProgramming