Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elo7/cookie-amd
Cookie.js is a library that manipulates browser cookie. This library uses amd structure.
https://github.com/elo7/cookie-amd
amd cookie front-end javascript lib martell nymeros
Last synced: 2 months ago
JSON representation
Cookie.js is a library that manipulates browser cookie. This library uses amd structure.
- Host: GitHub
- URL: https://github.com/elo7/cookie-amd
- Owner: elo7
- License: bsd-3-clause
- Created: 2015-06-19T14:36:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T16:10:15.000Z (almost 2 years ago)
- Last Synced: 2024-04-30T05:45:05.551Z (9 months ago)
- Topics: amd, cookie, front-end, javascript, lib, martell, nymeros
- Language: JavaScript
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 98
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cookie-amd
_Cookie-amd browser cookie library_
Cookie.js is a library that manipulates browser cookie. This library uses [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) structure.
[![Build Status](https://travis-ci.org/elo7/cookie-amd.svg?branch=master)](https://travis-ci.org/elo7/cookie-amd)
## Install
Install with [Npm](https://www.npmjs.com/): `npm install elo7-cookie-amd`
## Dependency
Cookie-amd depends on an [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) implementation. We suggest [define-async](https://www.npmjs.com/package/define-async) implementation for dependency lookup.
## Methods
#### get
`.get(name)`###### Description:
Returns a the cookie value.###### Sample:
``` js
define(['cookie'], function(cookie) {
cookie.get('cookie-name');
});
```#### set
`.set(name, value, days)`###### Description:
Creates or rewrite a cookie value with a defined expiration time in days.###### Sample:
``` js
define(['cookie'], function(cookie) {
cookie.set('cookie-name', 'value', 1);
});
```## License
Cookie-amd is released under the [BSD](https://github.com/elo7/cookie-amd/blob/master/LICENSE). Have at it.
* * *
Copyright :copyright: 2015 Elo7