https://github.com/h2non/asyncstore
A localStorage super shim with asynchronous asteroids using Web Workers (experimental)
https://github.com/h2non/asyncstore
Last synced: 4 months ago
JSON representation
A localStorage super shim with asynchronous asteroids using Web Workers (experimental)
- Host: GitHub
- URL: https://github.com/h2non/asyncstore
- Owner: h2non
- License: mit
- Created: 2015-01-22T15:35:52.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-25T01:47:08.000Z (almost 11 years ago)
- Last Synced: 2025-08-30T18:46:33.236Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 199 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asyncStore
A fully asynchronous `localStorage` implementation using Web Workers
**Note**: beta implementation. Do not use in production projects
## Installation
Install via npm
```
npm install asyncstore
```
Install via Bower
```
bower install asyncstore
```
Install via Component
```
component install h2non/asyncStore
```
Or loading the script remotely
```html
```
## Browser Support
 |  |  |  | 
--- | --- | --- | --- | --- |
+23 | +10 | +10 | +15 | +7 |
## Usage
The API mimics the [localStorage API](http://www.w3.org/TR/webstorage/#storage) with fully asynchronous based on `callbacks`
#### Read
```js
asyncStore.getItem(key, callback)
```
#### Write
```js
asyncStore.setItem(key, value, callback)
```
#### Remove
```js
asyncStore.removeItem(key, callback)
```
#### Clear
```js
asyncStore.clear(callback)
```
#### Length
```js
asyncStore.length // -> 1
```
## License
MIT - Tomas Aparicio