{"bugs":{"url":"https://github.com/ampproject/amp-toolbox/issues"},"dist":{"shasum":"6a6746b7e40bf78d0a9f919aad4d393dbed51e69","tarball":"https://registry.npmjs.org/@ampproject/toolbox-runtime-version/-/toolbox-runtime-version-1.0.0-beta.3.tgz","fileCount":5,"integrity":"sha512-srBgh9bDPGf3gEdHPx9vD4qxFz5knewh/mzOHKXMWFA68APoML2winwAunLIs/KBDRQfE7Ll7EY5przS2hy4Wg==","signatures":[{"sig":"MEUCIAiC4RRhnSdnx+yaO46doGtVzb/R0DsVR/2QEpuaN9yqAiEA4yY+WJGYH3BLSt2styaaYJaZaxWYi2sRMSOveiwrDC8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdC1bUCRA9TVsSAnZWagAAdNEQAJLB54vhNQk8XyibSk+l\nBwCaIQiKSIs5fginf7yPAlLuqGx9SqNwY8F/Onf8erb6YOUuiirEh4LIaZW3\nYOUNEslGOMpvJUQ53xYnFt/CpwcXpgDppNfIPk65v+8KIGdMt/FHHrM1sfJ1\nWyVvST69a217WVwOmVCs7RyDRGkPrb8GsF0TDhJyDp+Yc6AXZR9tO/hrCTsY\nn+zM0CoqHdCVRHbb/mkS5Qb9gyswwU8Wl2GPzzuqD9LSETV/POXBZmyZoFuk\nc4PSMT1DvCvv8m0GAcQm2Pc1wWCcUn5eN49K61ssUOZWgY+JPdjDeVmUfS/b\nj99+geuJaCS7KefIEl4ss0NMPu1MxJNu2MHAd8VwE6rIND0fI3AAHMQZrFqN\nl8RPH5ubHNGPlrhOhjr5z5R/LsOLzemlHXFy2EqoGNeIFo8KlzzHE+8NFO7t\nIRldVCm31DbWe2etsARzcrQa5uNtGklsz9DDxM4vOK4bU+DDmq0qqINBnhR1\nrK1WJKkK9DQnmCASxMO3ZKg5KsKHi9G8bdFeNPmo9frbqgAV1dVu4DJ/wHVp\nG27toD3KxCJzvxKeMVacp965BzyW3S2TDlWcRZAVIMxqIWPfzrBKl0wWBlaE\nvilFrYBMqdUIvwT712NlRIS+1uH/d56HiQSB2WZo4wMdXH2T5VQXts+R4prM\nlSFI\r\n=y1i+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"@ampproject/toolbox-runtime-version","author":{"name":"AMPHTML Team"},"readme":"# AMP Runtime Version\n\n[![npm version](https://badge.fury.io/js/@ampproject/toolbox-runtime-version.svg)](https://badge.fury.io/js/@ampproject/toolbox-runtime-version)\n\nUse it to query `cdn.ampproject.org` for the current release or canary version of the AMP Runtime. Uses a stale-while-revalidate caching strategy to avoid network requests in the critical path.\n\nYou can use the API to re-write AMP runtime URLs to their versioned counter parts to improve browser caching, e.g. to replace:\n\n```\nhttps://cdn.ampproject.org/v0.css\n```\n\nwith:\n\n```\nhttps://cdn.ampproject.org/rtv/001515617716922/v0.css\n```\n\n\n## Installation\n\nInstall via:\n\n```sh\nnpm install @ampproject/toolbox-runtime-version@beta\n```\n\n## Usage\n\nBasic usage:\n\n```js\nconst runtimeVersion = require('@ampproject/toolbox-runtime-version');\n\n// Release version\nruntimeVersion.currentVersion().then(version => {\n  console.log(version);\n});\n\n// Canary version\nruntimeVersion.currentVersion({canary: true}).then(version => {\n  console.log(version);\n});\n\n// Rewriting cache URLs\nconst ampRuntimeUrl = 'https://cdn.ampproject.org/v0.js';\nconst version = await runtimeVersion.currentVersion();\nconst versionedAmpRuntimeUrl = ampRuntimeUrl.replace(\n  'https://cdn.ampproject.org/',\n  'https://cdn.ampproject.org/rtv/' + version + '/'\n);\nconsole.log(versionedAmpRuntimeUrl);\n```\n\n","gitHead":"182e821deefc39940858ab46912e55f1f3da59f5","license":"Apache-2.0","_npmUser":{"name":"amp-toolbox","email":"amp-toolbox-eng@google.com"},"homepage":"https://github.com/ampproject/amp-toolbox/tree/master/packages/runtime-version","keywords":["amp"],"repository":{"url":"git+https://github.com/ampproject/amp-toolbox.git","type":"git"},"_npmVersion":"lerna/3.15.0/node@v10.16.0+x64 (darwin)","description":"AMP Runtime versions","directories":{},"maintainers":[{"name":"amp-toolbox","email":"amp-toolbox-eng@google.com"},{"name":"ampproject-admin","email":"admin@ampproject.org"},{"name":"choumx","email":"willchou@google.com"},{"name":"jridgewell","email":"justin+npm@ridgewell.name"},{"name":"kristoferbaxter","email":"kbax@me.com"},{"name":"prateekbh","email":"prateek89born@gmail.com"},{"name":"sepandparhami","email":"sparhami@google.com"}],"_nodeVersion":"10.16.0","dependencies":{"@ampproject/toolbox-core":"^1.0.0-beta.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/toolbox-runtime-version_1.0.0-beta.3_1561024211909_0.013335165838844087","host":"s3://npm-registry-packages"},"_id":"@ampproject/toolbox-runtime-version@1.0.0-beta.3","version":"1.0.0-beta.3"}