Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agrublev/local-storage-database
Localstorage database
https://github.com/agrublev/local-storage-database
database javascript localstorage
Last synced: about 2 months ago
JSON representation
Localstorage database
- Host: GitHub
- URL: https://github.com/agrublev/local-storage-database
- Owner: agrublev
- Created: 2022-02-21T17:06:58.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-06T14:48:29.000Z (over 2 years ago)
- Last Synced: 2024-12-05T20:15:19.072Z (2 months ago)
- Topics: database, javascript, localstorage
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [![NPM][1]][2]
[1]: https://img.shields.io/npm/v/local-storage-database.svg?style=flat
[2]: https://www.npmjs.org/package/local-storage-database__Local Storage Database consistency with objects.__
Simple class to store data and manage it easily.
### Just getting started?
Checkout example on codesandbox:
[![Edit local-storage-database](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/divine-haze-ikvh9t?fontsize=14&hidenavigation=1&theme=dark)
Import module:
```javascript
import Collection from "../release/localDatabase";
```Create the instance (or many):
```javascript
let myCollection = new Collection("test");
```Interact with it:
```javascript
let myCollection = new Collection("test");
// set some data
myCollection.set({ test: 2323, gra: 23 });
// update it with new data
myCollection.set({ awesome: 2323 });
// get entire json db
console.log(myCollection.get());
// or single key
console.log(myCollection.get("test"));
// remove single key
console.log(myCollection.remove("gra"));
// remove entire db
console.log(myCollection.remove());
```