Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shyrz/donut.js
🍩 Another local-storage solution.
https://github.com/shyrz/donut.js
cookie javascript localstorage sessionstorage userdata
Last synced: 26 days ago
JSON representation
🍩 Another local-storage solution.
- Host: GitHub
- URL: https://github.com/shyrz/donut.js
- Owner: shyrz
- License: mit
- Created: 2017-03-09T05:35:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-27T10:17:44.000Z (almost 8 years ago)
- Last Synced: 2024-10-23T14:10:22.202Z (2 months ago)
- Topics: cookie, javascript, localstorage, sessionstorage, userdata
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# donut.js
Another local-storage solution.
🍩 🍩 🍩 => oOo
## Usage
### Browser
```html// ...Code here whatever you like
```
### Node
```javascript
var oOo = require('donut.js');
// ...Code here whatever you like
```## API
### `oOo.cookie` [ or `donut.cookie` ]
#### `get(key)`
```javascript
oOo.cookie.get('key'); // { String } Cookie key name
```#### `getAll()`
```javascript
oOo.cookie.getAll();
```#### `set(key, value, options)`
```javascript
oOo.cookie.set('key', 'value', { // { String } Cookie key name and value
expires: 1, // { Number } Expires hours
domain: 'example.com', // { String } Domain
path: '/path/to/...', // { String } Path
secure: false, // { Boolean } Secure
httpOnly: false // { Boolean } HttpOnly
});
```#### `remove(key)`
```javascript
oOo.cookie.remove('key'); // { String } Cookie key name
```#### `removeAll()`
```javascript
oOo.cookie.removeAll();
```## License
**donut.js** © Phantr4x, Released under the [MIT](https://github.com/Phantr4x/donut.js/blob/master/LICENSE) License.
Authored and maintained by Phantr4x