{"_id":"@cakecatz/react-helmet-async","_rev":"2-ce76072ee99201358867d6b449c25fcd","name":"@cakecatz/react-helmet-async","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.5":{"name":"@cakecatz/react-helmet-async","version":"1.0.5","description":"Thread-safe Helmet for React 16+ and friends","main":"lib/index.js","umd:main":"lib/index.umd.js","module":"lib/index.module.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/cakecatz/react-helmet-async.git"},"author":{"name":"Scott Taylor","email":"scott.c.taylor@mac.com"},"license":"Apache-2.0","dependencies":{"@babel/runtime":"^7.3.4","invariant":"^2.2.4","prop-types":"^15.7.2","react-fast-compare":"^2.0.4","shallowequal":"^1.1.0"},"devDependencies":{"@babel/cli":"7.6.2","@babel/core":"7.6.2","@babel/plugin-proposal-class-properties":"7.5.5","babel-eslint":"10.0.1","babel-preset-kyt-react":"1.0.0-alpha.8d1d2ff9","enzyme":"3.10.0","enzyme-adapter-react-16":"1.15.1","enzyme-to-json":"3.4.2","eslint":"5.16.0","eslint-config-airbnb":"17.1.0","eslint-config-kyt":"1.0.0-alpha.8d1d2ff9","eslint-config-prettier":"4.2.0","eslint-plugin-import":"2.17.2","eslint-plugin-jest":"22.3.0","eslint-plugin-json":"1.4.0","eslint-plugin-jsx-a11y":"6.2.1","eslint-plugin-kyt":"1.0.0-alpha.8d1d2ff9","eslint-plugin-prettier":"3.1.0","eslint-plugin-react":"7.13.0","eslint-plugin-react-hooks":"1.6.0","jest":"24.5.0","jsdom":"15.2.0","microbundle":"^0.11.0","prettier":"1.17.1","raf":"3.4.1","react":"16.8.4","react-dom":"16.8.4","rimraf":"^2.6.3"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0"},"scripts":{"clean":"rimraf lib","lint":"eslint .","lint-fix":"eslint . --fix","test":"KYT_ENV_TYPE=test jest --no-cache","test-watch":"npm run test -- --watch","test-update":"npm run test -- -u","compile":"npm run clean && KYT_ENV_TYPE=client NODE_ENV=production microbundle --jsx React.createElement","prepare":"npm run compile"},"jest":{"setupFilesAfterEnv":["<rootDir>/jest.setup.js"],"testEnvironment":"node","testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["/node_modules/","/src/","/lib/","/es/"]},"gitHead":"cd16618017825ede4be859ae25a1938e4c8e16ab","bugs":{"url":"https://github.com/cakecatz/react-helmet-async/issues"},"homepage":"https://github.com/cakecatz/react-helmet-async#readme","_id":"@cakecatz/react-helmet-async@1.0.5","_nodeVersion":"11.14.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jVcXJcyiYi7/Xyn5TBOSGHv0whYzUsAmi5kPKspwRYu5+Emb0FA5Cr+nDeR8mymu3uc1yydzrbMCx+VDf4QmcA==","shasum":"f9d2e4763c41addcd2c8e0bf2b16c24ecfb10f34","tarball":"https://registry.npmjs.org/@cakecatz/react-helmet-async/-/react-helmet-async-1.0.5.tgz","fileCount":17,"unpackedSize":216704,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1ih2CRA9TVsSAnZWagAAgIEP/3RT4VoZ/ErNicbmgWTp\nJyyWwU8+1TgBv/wK5WYCeI1hczeBwysfoI5V/YeDaM4nmNP52v9ia5I1tVLH\naKoxti0YNrBVxxno3dqGNj2RN4tokRupQAO71BQ9ygAALxuAKYr1CV3ursAH\nu5BDt1yJfTGR5y/PBLwtzvxcrFATei2J3OTeQV90mvmDJ4xr4mfZxLxV9VTW\no91F9jL1q0aK1APjzJbZ3tjbSs9Tv1bgZCoLmorwr/PRKPvwNpH7ZMoqXbYX\nVcF/oyTTN9mPfuZhVNLgRc7ZaTzzuswm7A/4tJ8W2GaEHGLeMUYmWsW7/aQi\nvaQQHrNz5clp8Y24mvi60OyM/8qVrZYIdBsk3Cggv9ueWblJ1umj6zwWMdAH\nTmqhShsnjvKILyrJLIZJRXqwvSrUgHUHpNOt8NT2RqTHsUuhVbVb+KudBLY4\nIJ4wKhKNIAHPa8PIhnRq56c3hQWHSEVVTqKFj7YJ26LwvDLT+yQvMRCU+VMf\nK3s3Z2Qi/hF1y1qxe1hEuhMlest8u6TWloyzYBRsvgsiGCozVpsMr28mCvwZ\niBosV6x4M4wvWnxUFOZxRmV6EzT9Zig/mrkqrmqX7eGDpBzZOYO32gXYWvW/\ng/76Pj4aZllYv6MD2xRilbpk2RzQflFw+WjNxZ18MNUclejaHheFDpFgrY67\nry6V\r\n=6Ja6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCraVPLOboVaKB27hYx3bIk+MT7CIuCoRAvZzN+g2fr8AIga2Gru6oWB4T+FJ+mwhNq+o53IqfA/Kr5EQrX/cOowcY="}]},"maintainers":[{"name":"cakecatz","email":"mail.ryonarita@gmail.com"}],"_npmUser":{"name":"cakecatz","email":"mail.ryonarita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-helmet-async_1.0.5_1574316150336_0.5168543313830316"},"_hasShrinkwrap":false},"1.0.6":{"name":"@cakecatz/react-helmet-async","version":"1.0.6","description":"Thread-safe Helmet for React 16+ and friends","main":"lib/index.js","umd:main":"lib/index.umd.js","module":"lib/index.module.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/cakecatz/react-helmet-async.git"},"author":{"name":"Scott Taylor","email":"scott.c.taylor@mac.com"},"license":"Apache-2.0","dependencies":{"@babel/runtime":"^7.3.4","invariant":"^2.2.4","prop-types":"^15.7.2","react-fast-compare":"^2.0.4","shallowequal":"^1.1.0"},"devDependencies":{"@babel/cli":"7.6.2","@babel/core":"7.6.2","@babel/plugin-proposal-class-properties":"7.5.5","babel-eslint":"10.0.1","babel-preset-kyt-react":"1.0.0-alpha.8d1d2ff9","enzyme":"3.10.0","enzyme-adapter-react-16":"1.15.1","enzyme-to-json":"3.4.2","eslint":"5.16.0","eslint-config-airbnb":"17.1.0","eslint-config-kyt":"1.0.0-alpha.8d1d2ff9","eslint-config-prettier":"4.2.0","eslint-plugin-import":"2.17.2","eslint-plugin-jest":"22.3.0","eslint-plugin-json":"1.4.0","eslint-plugin-jsx-a11y":"6.2.1","eslint-plugin-kyt":"1.0.0-alpha.8d1d2ff9","eslint-plugin-prettier":"3.1.0","eslint-plugin-react":"7.13.0","eslint-plugin-react-hooks":"1.6.0","jest":"24.5.0","jsdom":"15.2.0","microbundle":"^0.11.0","prettier":"1.17.1","raf":"3.4.1","react":"16.8.4","react-dom":"16.8.4","rimraf":"^2.6.3"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0"},"scripts":{"clean":"rimraf lib","lint":"eslint .","lint-fix":"eslint . --fix","test":"KYT_ENV_TYPE=test jest --no-cache","test-watch":"npm run test -- --watch","test-update":"npm run test -- -u","compile":"npm run clean && KYT_ENV_TYPE=client NODE_ENV=production microbundle --jsx React.createElement","prepare":"npm run compile"},"jest":{"setupFilesAfterEnv":["<rootDir>/jest.setup.js"],"testEnvironment":"node","testMatch":["**/__tests__/**/*.test.js"],"testPathIgnorePatterns":["/node_modules/","/src/","/lib/","/es/"]},"gitHead":"101939447b85f13264556e0d18619c91127c42ac","bugs":{"url":"https://github.com/cakecatz/react-helmet-async/issues"},"homepage":"https://github.com/cakecatz/react-helmet-async#readme","_id":"@cakecatz/react-helmet-async@1.0.6","_nodeVersion":"11.14.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-2cb3fDNe3sTS+2exZWe1nvMw3PMhPYylI7HukyxV3uKEStiGH0bnhCd6i7u/QaHa5+fkVj8yoDHvGyeQ12n/kA==","shasum":"c01ee244cc1f56f3ec00eeaaf53a3d7bd7a901d3","tarball":"https://registry.npmjs.org/@cakecatz/react-helmet-async/-/react-helmet-async-1.0.6.tgz","fileCount":10,"unpackedSize":187714,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1ijNCRA9TVsSAnZWagAAnqkP/RNk3XHdYLQcXqq0O7C4\n/9dN6JNWvXZ64ha4f8atsqalR3yl7CocQromgnpIwQjQXVETDDQ0Fuqme27t\n61T3FGQqteh9QUI3M9WHiyvIVbw2OpzsGRqCtcAAOHmsQB6xFFquA/Str+KZ\nCZBi3I8NbXyZciQkSNccacFdGaQ7cpCMvPtmaohifuZNpV4D1FmZRjGyCZYT\noUvO3hPo+bXDUnOLxyOrzqLjVyeld7vjULfX4fKQZykquJktn0fwu6oZtnMB\nKYFiVBlBklGmnYuM0hrbJFN9BBNF1TaGdtAzZGQk65M6Hi2xB3ksKLLch085\nIH6tpobNbEzcQaYCsIoBp/lPV4qKNeMzdjdpDJvPvn/DOt7tKdxT5N/zlY9v\n/JAFHOskDYAJVMqEJsBns+8oq4qcimCQbEpqd5KHq17zp0Y2R86udPS65EDc\nfOMEeupQTq+RGheF6RUrZ0q9stIZw3Zjlu00FZCX/KrgNLrELU+LV5P+2SKa\nJQJzlmi2pDYpaT+DNDGBnFjDuY4UdkjnEMMUo03F3c5IoYU3PKDyWSyjWLgd\nsFL4ORCBU70b2QtgMxBzHLgVmFiLnLrtYT3FiBnJjzcp8YijOSKywWPyqaU6\n0w6wEuU25difBg+/YqCpHMuXkuzfkNwrS3MNJpbdn4EQRiwbLkymiOk1vajr\n/Mzb\r\n=st5m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8lB/RKnN/KVWZ/paRA/9egJnF3TNQfcEKdon6AYHXBAiEA8j6mE1ejKuZZlXsHaj3nQ9OjUJizonzeMCrRwO0UJiU="}]},"maintainers":[{"name":"cakecatz","email":"mail.ryonarita@gmail.com"}],"_npmUser":{"name":"cakecatz","email":"mail.ryonarita@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-helmet-async_1.0.6_1574316236919_0.664804106650573"},"_hasShrinkwrap":false}},"time":{"created":"2019-11-21T06:02:30.104Z","1.0.5":"2019-11-21T06:02:30.453Z","modified":"2022-04-04T21:31:31.404Z","1.0.6":"2019-11-21T06:03:57.070Z"},"maintainers":[{"name":"cakecatz","email":"mail.ryonarita@gmail.com"}],"description":"Thread-safe Helmet for React 16+ and friends","homepage":"https://github.com/cakecatz/react-helmet-async#readme","repository":{"type":"git","url":"git+ssh://git@github.com/cakecatz/react-helmet-async.git"},"author":{"name":"Scott Taylor","email":"scott.c.taylor@mac.com"},"bugs":{"url":"https://github.com/cakecatz/react-helmet-async/issues"},"license":"Apache-2.0","readme":"# react-helmet-async\n\n[![CircleCI](https://circleci.com/gh/staylor/react-helmet-async.svg?style=svg)](https://circleci.com/gh/staylor/react-helmet-async)\n\n[Announcement post on Times Open blog](https://open.nytimes.com/the-future-of-meta-tag-management-for-modern-react-development-ec26a7dc9183)\n\nThis package is a fork of [React Helmet](https://github.com/nfl/react-helmet).\n`<Helmet>` usage is synonymous, but server and client now requires `<HelmetProvider>` to encapsulate state per request.\n\n`react-helmet` relies on `react-side-effect`, which is not thread-safe. If you are doing anything asynchronous on the server, you need Helmet to encapsulate data on a per-request basis, this package does just that.\n\n## Usage\n\n**New is 1.0.0:** No more default export! `import { Helmet } from 'react-helmet-async'`\n\nThe main way that this package differs from `react-helmet` is that it requires using a Provider to encapsulate Helmet state for your React tree. If you use libraries like Redux or Apollo, you are already familiar with this paradigm:\n\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Helmet, HelmetProvider } from 'react-helmet-async';\n\nconst app = (\n  <HelmetProvider>\n    <App>\n      <Helmet>\n        <title>Hello World</title>\n        <link rel=\"canonical\" href=\"https://www.tacobell.com/\" />\n      </Helmet>\n      <h1>Hello World</h1>\n    </App>\n  </HelmetProvider>\n);\n\nReactDOM.hydrate(\n  app,\n  document.getElementById(‘app’)\n);\n```\n\nOn the server, we will no longer use static methods to extract state. `react-side-effect`\nexposed a `.rewind()` method, which Helmet used when calling `Helmet.renderStatic()`. Instead, we are going\nto pass a `context` prop to `HelmetProvider`, which will hold our state specific to each request.\n\n```javascript\nimport React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { Helmet, HelmetProvider } from 'react-helmet-async';\n\nconst helmetContext = {};\n\nconst app = (\n  <HelmetProvider context={helmetContext}>\n    <App>\n      <Helmet>\n        <title>Hello World</title>\n        <link rel=\"canonical\" href=\"https://www.tacobell.com/\" />\n      </Helmet>\n      <h1>Hello World</h1>\n    </App>\n  </HelmetProvider>\n);\n\nconst html = renderToString(app);\n\nconst { helmet } = helmetContext;\n\n// helmet.title.toString() etc…\n```\n\n## Streams\n\nThis package only works with streaming if your `<head>` data is output outside of `renderToNodeStream()`.\nThis is possible if your data hydration method already parses your React tree. Example:\n\n```javascript\nimport through from 'through';\nimport { renderToNodeStream } from 'react-dom/server';\nimport { getDataFromTree } from 'react-apollo';\nimport { Helmet, HelmetProvider } from 'react-helmet-async';\nimport template from 'server/template';\n\nconst helmetContext = {};\n\nconst app = (\n  <HelmetProvider context={helmetContext}>\n    <App>\n      <Helmet>\n        <title>Hello World</title>\n        <link rel=\"canonical\" href=\"https://www.tacobell.com/\" />\n      </Helmet>\n      <h1>Hello World</h1>\n    </App>\n  </HelmetProvider>\n);\n\nawait getDataFromTree(app);\n\nconst [header, footer] = template({\n  helmet: helmetContext.helmet,\n});\n\nres.status(200);\nres.write(header);\nrenderToNodeStream(app)\n  .pipe(\n    through(\n      function write(data) {\n        this.queue(data);\n      },\n      function end() {\n        this.queue(footer);\n        this.queue(null);\n      }\n    )\n  )\n  .pipe(res);\n```\n\n## Usage in Jest\nWhile testing in using jest, if there is a need to emulate SSR, the following string is required to have the test behave the way they are expected to.\n\n```\nimport { HelmetProvider } from 'react-helmet-async';\n\nHelmetProvider.canUseDOM = false;\n```\n\n## License\n\nLicensed under the Apache 2.0 License, Copyright © 2018 Scott Taylor\n","readmeFilename":"README.md"}