{"name":"universal-cookie","version":"4.0.1","description":"Universal cookies for JavaScript","main":"cjs/index.js","module":"es6/index.js","repository":{"type":"git","url":"git+https://github.com/reactivestack/cookies.git"},"bugs":{"url":"https://github.com/reactivestack/cookies/issues"},"homepage":"https://github.com/reactivestack/cookies/tree/master/packages/universal-cookie#readme","keywords":["universal","isomophic","cookie"],"author":{"name":"Benoit Tremblay","email":"benoit@reactivestack.com"},"license":"MIT","scripts":{"clean":"rimraf lib && rimraf es6 && rimraf cjs && rimraf umd","build":"npm run clean && npm run build-es6 && npm run build-cjs && npm run build-umd && npm run build-legacy","build-es6":"tsc","build-cjs":"babel es6 -D -d cjs","build-umd":"rollup -c","build-legacy":"babel es6 -D -d lib"},"dependencies":{"@types/cookie":"^0.3.3","@types/object-assign":"^4.0.30","cookie":"^0.4.0","object-assign":"^4.1.1"},"devDependencies":{"@babel/cli":"^7.0.0","rimraf":"^2.6.1","rollup":"^1.16.4","typescript":"^3.0.1"},"_id":"universal-cookie@4.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cuDhHbg7JCix3ju9DkrL45ubo7HKjnmMksK1nAdO/cqXgzGGGPzjhAIwDXC5pM3HeTZdrj3RWlNCD5M1xGEzNw==","shasum":"7e566c2f936bc4c227587638e29c807aa785694e","tarball":"http://registry-npm.ywwl.com/universal-cookie/download/universal-cookie-4.0.1.tgz","fileCount":30,"unpackedSize":52364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHWRrCRA9TVsSAnZWagAAa3QP/1my4xS5lyj3mLPX81Mg\n4N171X37CUOcp9/7tyDP6rzyy7QCXeLK/cENi+PrKx9qbnjmCPctg3iF5svL\naE4Wopf5LiogRjUqAHbN8AORVUUsth0PhGUNQca+aiRe0frg2wcHkzrWi7MX\nNNAQII6y+jW6/HlQpR9CXQVmwQ1e9JT2f491Xyzi/dZw4t54EkM9zOhsU9y+\n7s0dhnx/p/TDEzdVVCtx4Bjm10GEXC60aldhZKurHvG41ETTZYHFBFhhp9MS\ndEc+381CANdZ6ZZZMIe7ePBuqsCOXqSGzw0fqeu5FBHPnRI41IQpjjywXydH\nmWrlzB5s1brovMO5aBvo9Y13swjyKBwrABVpPbX+jZQnXB9Wq17KxB9iBwp4\nykjIrrgoRmkiE8fymynMCxr52ck/sDsH7pWZXJwgKAu0LcgHsWRR+pocKGSC\n6/WccvxQM1lVUlWwAdXiL0F9GfYZU13IkLLqNeK08X/uOhuzI3RsO7e+9Ohm\nJIny5JCDxk+qpY9dbgPopnnQoM6DdZlwXAnFIAxJukpwYSK15H9tHkQdS22x\nVl5p0UhNubrxh/2Jxj1GLq9zA0k+AR1QHfio4bGIi2OtcttVVOW/53cwOu0C\npnRSiB2RCsiIJKBYvrgLYx/QMSQo5f3SgDZyMy+kmHizd75P11UdQdTskSIu\n4pAz\r\n=T+CW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUpzWfKL7KoDcGXavEf4tKd1UkrrM2PgcUoYx7qIQNsAiBwqVv6t7j7F9ceV8NWkw5p1PR9uj/LmwPX2eIB8IyV7g=="}],"size":10927,"noattachment":false,"key":"/universal-cookie/-/universal-cookie-4.0.1.tgz"},"maintainers":[{"name":"exon","email":"trembl.ben@gmail.com"}],"_npmUser":{"name":"exon","email":"trembl.ben@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/universal-cookie_4.0.1_1562207338681_0.6410324969844365"},"_hasShrinkwrap":false,"readme":"<h3 align=\"center\">\n  universal-cookie\n</h3>\n\n<p align=\"center\">\n  Universal cookies for JavaScript<br />\n  <a href=\"https://badge.fury.io/js/universal-cookie\"><img src=\"https://badge.fury.io/js/universal-cookie.svg\" /></a>\n  <img src=\"https://github.com/github/docs/actions/workflows/test.yml/badge.svg\" />\n</p>\n\n## Integrations\n\n- [`react-cookie`](https://www.npmjs.com/package/react-cookie) - Universal cookies for React\n- [`universal-cookie-express`](https://www.npmjs.com/package/universal-cookie-express) - Hook cookies get/set on Express for server-rendering\n\n## Getting started\n\n`npm install universal-cookie`\n\nor in the browser (global variable `UniversalCookie`):\n\n```html\n<script\n  crossorigin\n  src=\"https://unpkg.com/universal-cookie@7/umd/universalCookie.min.js\"\n></script>\n```\n\n## API - Cookies class\n\n### `constructor([cookieHeader], [defaultSetOptions])`\n\nCreate a cookies context\n\n- cookieHeader (string|object): specify the cookie header or object\n- defaultSetOptions (object): specify the default options when setting cookies\n  - path (string): cookie path, use `/` as the path if you want your cookie to be accessible on all pages\n  - expires (Date): absolute expiration date for the cookie\n  - maxAge (number): relative max age of the cookie from when the client receives it in seconds\n  - domain (string): domain for the cookie (sub.domain.com or .allsubdomains.com)\n  - secure (boolean): Is only accessible through HTTPS?\n  - httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**\n  - sameSite (boolean|none|lax|strict): Strict or Lax enforcement\n  - partitioned (boolean): Indicates that the cookie should be stored using partitioned storage\n\n### `get(name, [options])`\n\nGet a cookie value\n\n- name (string): cookie name\n- options (object):\n  - doNotParse (boolean): do not convert the cookie into an object no matter what\n\n### `getAll([options])`\n\nGet all cookies\n\n- options (object):\n  - doNotParse (boolean): do not convert the cookie into an object no matter what\n\n### `set(name, value, [options])`\n\nSet a cookie value\n\n- name (string): cookie name\n- value (string|object): save the value and stringify the object if needed\n- options (object): Support all the cookie options from RFC 6265\n  - path (string): cookie path, use `/` as the path if you want your cookie to be accessible on all pages\n  - expires (Date): absolute expiration date for the cookie\n  - maxAge (number): relative max age of the cookie from when the client receives it in seconds\n  - domain (string): domain for the cookie (sub.domain.com or .allsubdomains.com)\n  - secure (boolean): Is only accessible through HTTPS?\n  - httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**\n  - sameSite (boolean|none|lax|strict): Strict or Lax enforcement\n  - partitioned (boolean): Indicates that the cookie should be stored using partitioned storage\n\n### `remove(name, [options])`\n\nRemove a cookie\n\n- name (string): cookie name\n- options (object): Support all the cookie options from RFC 6265\n  - path (string): cookie path, use `/` as the path if you want your cookie to be accessible on all pages\n  - expires (Date): absolute expiration date for the cookie\n  - maxAge (number): relative max age of the cookie from when the client receives it in seconds\n  - domain (string): domain for the cookie (sub.domain.com or .allsubdomains.com)\n  - secure (boolean): Is only accessible through HTTPS?\n  - httpOnly (boolean): Is only the server can access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.**\n  - sameSite (boolean|none|lax|strict): Strict or Lax enforcement\n  - partitioned (boolean): Indicates that the cookie should be stored using partitioned storage\n\n### `addChangeListener(callback)`\n\nAdd a listener to when a cookie is set or removed.\n\n- callback (function): Call that will be called with the first argument containing `name`, `value` and `options` of the changed cookie.\n\n### `removeChangeListener(callback)`\n\nRemove a listener from the change callback.\n\n### `update()`\n\nRead back the cookies from the browser and triggers the change listeners. This should normally not be necessary because this library detects cookie changes automatically.\n\n## Browser Example\n\n```js\nimport Cookies from 'universal-cookie';\n\nconst cookies = new Cookies(null, { path: '/' });\n\ncookies.set('myCat', 'Pacman');\nconsole.log(cookies.get('myCat')); // Pacman\n```\n\n## Server Example\n\n```js\nimport Cookies from 'universal-cookie';\n\nconst cookies = new Cookies(req.headers.cookie, { path: '/' });\n\nconsole.log(cookies.get('myCat')); // Pacman or undefined if not set yet\n```\n","publish_time":1562207338816,"_cnpm_publish_time":1562207338816,"dist-tags":{"latest":"8.1.2"}}