@ou-imdt/create
Version:
Command line tool to create team boilerplate.
21 lines (18 loc) • 627 B
JavaScript
const process = require('process');
const { execSync } = require('child_process');
const pkg = require('../package.json');
/**
* Module returns dynamic template {{vars}}.
*
* Note: User prompts are exported in questions.js and then the template
* vars extended with user responses while generating the boilerplate.
*
* @return {Object}
*/
module.exports = async () => {
const currentNodeVersion = process.versions.node;
const currentNPMVersion = execSync('npm -v').toString().trim();
const packageVersion = pkg.version;
const vars = {currentNodeVersion, currentNPMVersion, packageVersion};
return vars;
};