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

https://github.com/kevinrodriguez-io/persistence.js

Just a helper module to allow JSON objects to be saved to the localStorage object
https://github.com/kevinrodriguez-io/persistence.js

Last synced: 8 months ago
JSON representation

Just a helper module to allow JSON objects to be saved to the localStorage object

Awesome Lists containing this project

README

          

# persistence.js

This is just a helper javascript module to allow JSON objects to be stored on the localStorage object.

Coming soon:
- Cookies failover
- Allow to choose between localStorage and sessionStorage

## Usage

To save a JSON object:

`var johnDoe = { name: 'John', lastName: 'Doe' }`

`LocalStoragePersistence.saveJsonObject('userData-johnDoe', johnDoe)`

To retrieve a JSON object:

`var johnDoe = LocalStoragePersistence.loadJsonObject('userData-johnDoe')`