https://github.com/harsh-sri/local-storage
This module helps you to access Local Storage easily: ReactJS
https://github.com/harsh-sri/local-storage
Last synced: about 1 month ago
JSON representation
This module helps you to access Local Storage easily: ReactJS
- Host: GitHub
- URL: https://github.com/harsh-sri/local-storage
- Owner: harsh-sri
- License: mit
- Created: 2019-05-14T07:39:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-14T08:50:18.000Z (about 6 years ago)
- Last Synced: 2025-02-15T18:04:44.712Z (3 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# local-storage
This module helps you to access Local Storage easily: ReactJS## Install
```bash
npm install localstorage
```## Example
```javascript
import { localStorage } from 'localStorage';
//save Object into local storage
localStorage.setObj('user', {'foo':'bar'});
// get object from local storage
localStorage.getObj('user');
// save string/number into local storage
localStorage.set('name', 'harsh');
//get value from local storage by key name
localStorage.get('name');
// remove item from local storage
localStorage.remove('keyname');
// clear local storage
localStorage.clear();
```## License
MIT