Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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