How to use latest-semver - 2 common examples

To help you get started, we’ve selected a few latest-semver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kong / kuma-website / docs / .vuepress / theme / store / index.js View on Github external
import Vue from 'vue'
import Vuex from 'vuex'
import ToSemver from 'to-semver'
import LatestSemver from 'latest-semver'
import releases from '../../public/releases.json'
import installMethods from '../../public/install-methods.json'

Vue.use(Vuex)

// storing the latest version since we use it often
let latestRelease = LatestSemver(releases)

export default new Vuex.Store({
  state: {
    releases: ToSemver(releases),
    latestRelease: latestRelease,
    selectedDocVersion: latestRelease,
    selectedInstallVersion: latestRelease,
    installMethods: installMethods,
    requestADemoEndpoint: 'https://script.google.com/macros/s/AKfycbwiFfaiSK6JqdNqZLAt5PRayPV43x7qw1ZAM_-sFSDg6IT44d4/exec',
    newsletterSignupEndpoint: 'https://script.google.com/macros/s/AKfycbx9xikTdHNrrnHiqxNX3ecVkTJYzPmKemrz2OMr6SaOXT7FYaiM/exec'
  },

  getters: {
    getInstallMethods: (state) => state.installMethods,
    getReleaseList: (state) => state.releases,
    getLatestRelease: (state) => state.latestRelease,
github reactioncommerce / reaction-cli / src / utils / check_release.js View on Github external
export async function getLatestReactionRelease() {
  try {
    const res = await fetch('https://api.github.com/repos/reactioncommerce/reaction/releases');
    const releases = await res.json();
    const tags = [];
    releases.forEach((r) => tags.push(r.tag_name));
    return getLatest(tags);
  } catch (err) {
    return null;
  }
}

latest-semver

Get the latest stable semver version from an array of versions

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Popular latest-semver functions