Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

js-data logo

# [![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());
```