yfiles
Version:
A dummy package that helps you download and install yFiles for HTML and the 'yFiles dev suite'.
32 lines (26 loc) • 1.45 kB
JavaScript
var kleur = require('kleur')
console.error(kleur.bold('\nYou probably do not need this module, which is mostly a placeholder.'))
console.error(kleur.bgBlue(kleur.white(kleur.bold('Please download yFiles for HTML from https://yworks.com/yfileshtml , instead'))))
console.log('yFiles for HTML itself is not currently available publicly on npm registries, but may be uploaded ' +
'to your private registries from a licensed package.\n')
console.error('If instead you wanted to run the yFiles Dev Suite tool, please install and run it via:')
console.error(kleur.bgBlue(kleur.white(kleur.bold('> npm i -g yfiles-dev-suite'))))
console.error(kleur.bgBlue(kleur.white(kleur.bold('> yfiles-dev-suite'))))
var readline = require("readline");
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Do you want me to install and run the dev-suite for you, now? [yes/NO]', function(result){
rl.close()
if ((/^y(es)?$/gi).test(result)){
var exec = require('child_process');
console.log('running');
console.log(kleur.bold('npm i -g yfiles-dev-suite'))
exec.execSync('npm i -g yfiles-dev-suite', {windowsHide:true, stdio:'inherit'});
console.log('\nexecuting');
console.log(kleur.bold('yfiles-dev-suite'))
exec.execSync('yfiles-dev-suite', {windowsHide:true, stdio:'inherit'});
}
})