@ampproject/toolbox-runtime-version
AMP Runtime versions
Last updated 7 years ago by amp-toolbox .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ampproject/toolbox-runtime-version 
SYNC missed versions from official npm registry.

AMP Runtime Version

npm version

Use 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.

You can use the API to re-write AMP runtime URLs to their versioned counter parts to improve browser caching, e.g. to replace:

https://cdn.ampproject.org/v0.css

with:

https://cdn.ampproject.org/rtv/001515617716922/v0.css

Installation

Install via:

npm install @ampproject/toolbox-runtime-version

Usage

Basic usage:

const runtimeVersion = require('@ampproject/toolbox-runtime-version');

// Release version
runtimeVersion.currentVersion().then(version => {
  console.log(version);
});

// Canary version
runtimeVersion.currentVersion({canary: true}).then(version => {
  console.log(version);
});

// Rewriting cache URLs
const ampRuntimeUrl = 'https://cdn.ampproject.org/v0.js';
const version = await runtimeVersion.currentVersion();
const versionedAmpRuntimeUrl = ampRuntimeUrl.replace(
  'https://cdn.ampproject.org/',
  'https://cdn.ampproject.org/rtv/' + version + '/'
);
console.log(versionedAmpRuntimeUrl);

Current Tags

  • 2.7.1-alpha.0                                ...           alpha (5 years ago)
  • 1.1.0-beta.0                                ...           beta (7 years ago)
  • 3.0.0-canary.2                                ...           canary (4 years ago)
  • 2.9.0                                ...           latest (4 years ago)

40 Versions

  • 2.9.0                                ...           4 years ago
  • 3.0.0-canary.2                                ...           4 years ago
  • 2.8.0                                ...           5 years ago
  • 2.8.0-canary.15                                ...           5 years ago
  • 2.8.0-canary.9                                ...           5 years ago
  • 2.8.0-canary.0                                ...           5 years ago
  • 2.7.4                                ...           5 years ago
  • 2.7.2                                ...           5 years ago
  • 2.7.1                                ...           5 years ago
  • 2.7.1-alpha.0                                ...           5 years ago
  • 2.7.0-alpha.1                                ...           6 years ago
  • 2.6.0                                ...           6 years ago
  • 2.5.4                                ...           6 years ago
  • 2.5.1                                ...           6 years ago
  • 2.5.0                                ...           6 years ago
  • 2.4.0-alpha.1                                ...           6 years ago
  • 2.4.0-alpha.0                                ...           6 years ago
  • 2.3.1                                ...           6 years ago
  • 2.3.0                                ...           6 years ago
  • 2.2.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 2.0.0-alpha.7                                ...           6 years ago
  • 2.0.0-alpha.4                                ...           6 years ago
  • 2.0.0-alpha.0                                ...           6 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.1.0-beta.1                                ...           7 years ago
  • 1.1.0-beta.0                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 1.0.0-beta.9                                ...           7 years ago
  • 1.0.0-beta.8                                ...           7 years ago
  • 1.0.0-beta.7                                ...           7 years ago
  • 1.0.0-beta.6                                ...           7 years ago
  • 1.0.0-beta.5                                ...           7 years ago
  • 1.0.0-beta.4                                ...           7 years ago
  • 1.0.0-beta.3                                ...           7 years ago
  • 1.0.0-beta.2                                ...           7 years ago
  • 1.0.0-beta.0                                ...           7 years ago

Copyright 2013 - present © cnpmjs.org | Home |