simple-cookie
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "simple-cookie", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Simple cookie parser & serializer", | ||
@@ -25,4 +25,5 @@ "main": "index.js", | ||
"chai": "^1.9.1", | ||
"chai-as-promised": "^4.1.1", | ||
"mocha": "^1.21.4" | ||
} | ||
} |
@@ -7,2 +7,56 @@ #RESERVED | ||
##install | ||
npm install simple-cookie | ||
npm install simple-cookie | ||
#usage | ||
```javascript | ||
var cookie = require('simple-cookie'); | ||
var cookieObject = { | ||
name: 'cookieName', | ||
value: 'cookie value', | ||
expires: (new Date()).valueOf() + 500000, | ||
path: '/', | ||
domain: 'domain.com', | ||
httponly: false, | ||
secure: true | ||
} | ||
``` | ||
What is `cookieObject`: | ||
**name** `String` : cookie name | ||
**value** `String` : cookie value | ||
**expires** `DateString | Number | Date` (optional) : expire date | ||
**path** `DateString | Number | Date` (optional) : cookie path, defaults to `/` | ||
**domain** `String` (optional) : cookie domain | ||
**httponly** `Boolean` (optional) : defaults to `false` | ||
**secure** `Boolean` (optional) : defaults to `false` | ||
##methods | ||
```javascript | ||
var cookieString = cookie.stringify( cookieObject ); | ||
# cookieName=cookie%20value; Expires: dateString; Max-Date: Number; Path=/; domain=domain.com; secure | ||
cookie.parse( cookieString [, defaultPath] [, defaultDomain] ); | ||
# will create object like the 'cookieObject' | ||
cookie.tokenize([ | ||
{name:'cookie1','cvalue1'}, | ||
{name:'cookie2','cvalue2'}, | ||
{name:'cookie3','cvalue3'} | ||
]); | ||
# cookie1=cvalue1; cookie2=cvalue2; cookie3=cvalue3 | ||
``` | ||
chhers, | ||
[jujiyangasli.com](http://jujiyangasli.com) |
Sorry, the diff of this file is not supported yet
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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
5313
87
62
0
3