HTML5 web storage API JavaScript module
- Abstracts the native storage APIs into a simple intuitive interface
- Uses native
localStorage
andsessionStorage
where available - Gracefully degrades to temporary storage
- Works standalone or with build tools like browserify or ender
API (0.8)
cargo.local(key?, value?)
cargo.local()
get allcargo.local(key)
getcargo.local(key, value)
setcargo.local(key, undefined)
remove
cargo.local.get(key)
cargo.local.set(key, value)
cargo.local.remove(key)
cargo.session(key?, value?)
cargo.session()
get allcargo.session(key)
getcargo.session(key, value)
setcargo.session(key, undefined)
remove
cargo.session.get(key)
cargo.session.set(key, value)
cargo.session.remove(key)
cargo.temp(key?, value?)
cargo.temp()
get allcargo.temp(key)
getcargo.temp(key, value)
setcargo.temp(key, undefined)
remove
cargo.temp.get(key)
cargo.temp.set(key, value)
cargo.temp.remove(key)
- local storage stores for unlimited browser sessions
- session storage stores for the current browser session
- temp storage stores until the user refreshes or closes the current page
Support this project by tipping the developer =)
MIT