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
- Host: GitHub
- URL: https://github.com/kevinrodriguez-io/persistence.js
- Owner: kevinrodriguez-io
- License: mit
- Created: 2017-09-26T15:12:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T15:22:40.000Z (about 8 years ago)
- Last Synced: 2024-11-22T13:42:40.589Z (12 months ago)
- Language: JavaScript
- Homepage: http://kevinrodriguez.io/
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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')`