{"size": 574, "ext": "js", "max_stars_repo_path": "lib/version.js", "max_stars_repo_name": "fracz/node-composer-runner", "max_stars_repo_stars_event_min_datetime": "2017-09-15T16:32:40.000Z", "max_stars_repo_stars_event_max_datetime": "2017-09-15T16:32:40.000Z", "max_issues_repo_path": "lib/version.js", "max_issues_repo_name": "fracz/node-composer-runner", "max_issues_repo_issues_event_min_datetime": "2015-11-22T18:19:49.000Z", "max_issues_repo_issues_event_max_datetime": "2019-07-11T07:27:54.000Z", "max_forks_repo_path": "lib/version.js", "max_forks_repo_name": "fracz/node-composer-runner", "max_forks_repo_forks_event_min_datetime": "2017-09-15T11:00:27.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-10T18:49:38.000Z"}
{"max_stars_count": 1, "max_issues_count": 5, "max_forks_count": 4, "avg_line_length": 24.9565217391, "max_line_length": 65, "alphanum_fraction": 0.7038327526}
'use strict';

const path = require('path');

// find the right version
const pkg = require('../package.json');
let cwdPkg;
try {
  const packageFolder = path.join(process.cwd(), 'package.json');
  cwdPkg = require(packageFolder);
} catch (e) { /* do nothing */ }

// default version is defined from this repository
let version = pkg.engines.composer;
// try to override the version if defined in the cwd package
if (cwdPkg && cwdPkg.engines && cwdPkg.engines.composer) {
  version = cwdPkg.engines.composer;
}

module.exports = function getVersion() {
  return version;
};
