ember-cli/ember-try-config

View on GitHub
lib/fetch-ember-versions.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

let packageJSON = require('package-json');

module.exports = async function fetchEmberVersions(options = {}) {
  let _packageJSON = options.packageJSON || packageJSON;

  try {
    let data = await _packageJSON('ember-source', { allVersions: true });

    return Object.keys(data.versions);
  } catch (err) {
    if (options.logErrors) {
      console.log(err.stack);
      throw err;
    }
    return [];
  }
};