Code your idea away and send me a pull request.
Easy Storage is a Javascript Library that makes Localstorage, SessionStorage and Cookies, easier and quicker to type.
- Create a Localstorage Item
- Retrive a Localstorage Item
- Remove a Localstorage Item
- Clear Localstorage
- Create a Session Storage Item
- Retrive a Session Storage Item
- Remove a Session Storage Item
- Clear Session Storage
To create a Localstorage Item do the following code:
es.crtLSI(value, key)
Example:
es.crtLSI("Name", "John")
All that is needed to do to retrive a Localstorage item is:
var myVar = es.getLSI(key)
Example:
var name = es.getLSI("name")
To remove a localstorage item the following code is needed:
es.removeLSI(key)
Example:
es.removeLSI("name")
Type the following code to clear all the localstorage
es.clearLSI()
Example:
if(3 + 3 == 6) {
es.clearLSI()
}
To create a Session Storage Item do the following code:
es.crtSS(value, key)
Example:
es.crtSS("Name", "John")
All that is needed to do to retrive a Session Storage item is:
var myVar = es.getSS(key)
Example:
var name = es.getSS("name")
To remove a Session Storage item the following code is needed:
es.removeSS(key)
Example:
es.removeSS("name")
Type the following code to clear all the Session Storage
es.clearSS()
Example:
if(4 + 5 > 1) {
es.clearSS()
}
To create a Cookie, do the following code:
Expires, and Date is optional
es.crtCookie(cookie, value, expires, date)
Example:
es.crtCookie("Name", "John", "Thu", "01 Jan 1970 00:00:00 GMT")
All that is needed to do to retrive a Cookie is:
var myVar = es.getCookie(cookie)
Example:
var name = es.getCookie("name")
To remove a Cookie, the following code is needed:
es.removeCookie(cookie)
Example:
es.removeCookie("name")
Type the following code to clear all the Cookies
es.clearSS()
Example:
if(9 * 5 == 45) {
es.clearCookie()
}