browser-cookie
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "browser-cookie", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Standalone cookie class for the browser.", | ||
@@ -10,3 +10,3 @@ "author": "muji <noop@xpm.io>", | ||
}, | ||
"dependencies": {}, | ||
"main": "lib/cookie.js", | ||
"devDependencies": { | ||
@@ -65,2 +65,3 @@ "brfs": "~1.4.0", | ||
"install.md", | ||
"api.md", | ||
"developer.md", | ||
@@ -67,0 +68,0 @@ "license.md" |
@@ -6,2 +6,9 @@ Table of Contents | ||
* [Install](#install) | ||
* [Cookie](#cookie-1) | ||
* [Options](#options) | ||
* [Methods](#methods) | ||
* [cookie.set(key, value, [options])](#cookiesetkey-value-options) | ||
* [cookie.get(key, [value])](#cookiegetkey-value) | ||
* [cookie.del(key)](#cookiedelkey) | ||
* [cookie.clear(except, [options])](#cookieclearexcept-options) | ||
* [Developer](#developer) | ||
@@ -31,2 +38,33 @@ * [Test](#test) | ||
## Cookie | ||
The `Cookie` class exposes the ability to get, set and delete cookie values. | ||
### Options | ||
* `raw` - Do not URI encode the cookie value. | ||
* `json` - Store the cookie value as JSON. | ||
* `expires` - Define lifetime of the cookie in days, default is 30. | ||
* `path` - Define the path where the cookie is valid, default is /. | ||
* `domain` - Define the domain whether the cookie is valid. | ||
* `secure` - If true, the cookie transmission requires a secure protocol (https). | ||
### Methods | ||
#### cookie.set(key, value, [options]) | ||
Sets a cookie value. | ||
#### cookie.get(key, [value]) | ||
Gets a cookie value. If the `value` parameter is specified it should be a conversion function, if no key is specified an object containing all key value pairs is returned. | ||
#### cookie.del(key) | ||
Deletes a cookie value. | ||
#### cookie.clear(except, [options]) | ||
Clear all cookies except the keys listed in the `except` array. | ||
## Developer | ||
@@ -33,0 +71,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10763
152
5
164