{"name":"universal-cookie","version":"2.2.0","description":"Universal cookies for JavaScript","main":"lib/index.js","files":["lib"],"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":{"build":"rimraf lib && babel src -d lib --ignore __tests__"},"dependencies":{"cookie":"^0.3.1","object-assign":"^4.1.0"},"devDependencies":{"babel-cli":"^6.24.1","rimraf":"^2.6.1"},"_id":"universal-cookie@2.2.0","_npmVersion":"6.0.1","_nodeVersion":"8.9.2","_npmUser":{"name":"exon","email":"trembl.ben@gmail.com"},"dist":{"integrity":"sha512-weEuvQvnMs74WGwqKSbeapCRv/7ATHDCqrfZtj579r3fQCxcwtoXYMoaZ8YOCQga/ctQTYy20xMOH1u7cAAU6w==","shasum":"328dc3883cf0ebd5b4904902033ad4dfdb907ed2","tarball":"http://registry-npm.ywwl.com/universal-cookie/download/universal-cookie-2.2.0.tgz","fileCount":5,"unpackedSize":10452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbJHa2CRA9TVsSAnZWagAA8cwP/RoN1Xo0h0ExRybizlW1\n+Fs4H9Zoy/BEywsxXUFyLou2U3iE/fEfTw/FOWFgCDKWkSkCMUX5lkLY7fAN\neRmwJ2kUQUbIvbYfDdEH7Zx71Gl86k2zr1Gp2jb4rLlAOyLBnoOs0nqpcOVP\nd/Ic1fUCKIr1ZyCnRZZpUEeJX9VgwCUZ3yzC2Wqrm2UK7gHuBPbvWfLPSagy\nvJ30BAUpwy/8PeCiv3bK200sWyqQWnh1nzCOlUuv9B34umTlqeTlzBLMMkM1\n+DIeF2JPJgNMTOEmkLbCJk2tRViNdFqdLJS7qE76TVHdVGWuaG0HWkgc2V1f\nzO0OW5cPP9F7sKWj7CxQURFK5nQaxWx/RHcfsFQGKYLzhrS1Fh3OQgjyU6T/\nLAdB8jr/R4OqRw/fb05eY6KxpivtEXYlWvOpTkGd1AhU+JNaHmMDbB5NkT2f\n+Cubss4L135giiZB4DltqcmEUvec+ym1PDsq1VpvzvL0RjKuUKhR8rB2nZl7\nUDWidJJ4JlCxzk9h08TL6u5OwMdEbzSk6bLqxsgOuOLRJq0MfFqsVRjb4sGV\nMpzq0A/FcHqzxF/FhklOlkq3FGrXB+P8TmWOe4V2gUW5wXAm8Fr6BGU2dh62\nKuBfzTw+Rhk1k8sX6ct7nDgg1GcmxMOfoB+hWLyGWvMLiSspnt4Wx/4IZh5P\no6IS\r\n=Dl2c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfvm33AhrsKg4P0ANjSvNWTP8AM5ERbWg6V2KCF3BImgIhAIUUTTXn3Y5ylO86gTgod6/T4lDXWu+/75hbP5Ny0Jlu"}],"size":3307,"noattachment":false,"key":"/universal-cookie/-/universal-cookie-2.2.0.tgz"},"maintainers":[{"name":"exon","email":"trembl.ben@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/universal-cookie_2.2.0_1529116342152_0.30682030653974257"},"_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":1529116342230,"_cnpm_publish_time":1529116342230,"dist-tags":{"latest":"8.1.2"}}