Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haizzz/nocajs
A small library to easily manipulate localStorage
https://github.com/haizzz/nocajs
Last synced: 15 days ago
JSON representation
A small library to easily manipulate localStorage
- Host: GitHub
- URL: https://github.com/haizzz/nocajs
- Owner: Haizzz
- Created: 2015-03-29T11:20:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-29T12:04:19.000Z (over 9 years ago)
- Last Synced: 2024-10-10T20:49:24.935Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://coderkit.github.io/NocaJs
- Size: 211 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [NocaJS](http://coderkit.github.io/NocaJs)
A small library to easily manipulate javascript localStorage
#Dependencies
Noca.js doesn't have any dependencies
#Usage
First, create a new instance of Noca:
```js
var foobar = new noca();
```then use one of these methods:
```js
// all values are stored as string
foobar.update(name, content);
// Update your variable. If the variable doesn't exist, it will create a new one
// name = name your localStorage variable
// content = the value of your variable
foobar.remove(name);
// Remove your variable from localStorage
// name = name of the variable you want to remove
foobar.clear(name);
// Set variable value to ""
// name = name of the variable you want to clear
foobar.setStandard(name, content);
// Set a default value for your variable
// name = name of the variable you want to et a standard for
// content = the default content you want to set
foobar.reset(name);
// Reset the variable to the standard set. If no standard is set, it won't do anything
// name = the name of the variable you want to reset
```#Credit
©2015 Coderkit All right reserved