Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
update: function(options) {
if (options) {
Object.assign(config, options);
}
// Command line argument
//var filePath = process.argv[2].replace(config.workingDir, '');
var self = this;
console.log('\n' + clc.blue.bold('Looking for broken module references in ') + clc.blue(config.workingDir));
parser.getAll(config)
.then(function(references) {
updater.existingFiles = references.existingFiles;
updater.referencedFiles = references.referencedFiles;
updater.brokenReferences = references.brokenReferences;
console.log(clc.blue.bold('Searching ' + Object.keys(updater.existingFiles).length + ' files\n'));
updater.printReport();
updater.promptToCorrect();
}).catch(function(err) {
console.error(err);
});
},
console.log(Object.keys(csums).sort(function (a, b) { return csums[a].length - csums[b].length; }).map(function (csum) {
return color.blue('[' + csums[csum].join(', ') + '] ') + color.magenta(memberships[csum]);
}).join('\n'));
}
function addPackageForDatabase(engine) {
console.log(clc.blue(`Install package for database engine ${engine}...`));
child_process_1.execSync(`yarn add ${engine} -W`, {
cwd: process.cwd(),
env: process.env,
stdio: ["ignore", process.stdout, process.stderr],
});
console.log(clc.blue(`Installed package ${engine}`));
}
async function addAdministrationUser(username, email, password, database) {
function logMsg(who, msg) {
console.log(color.blue('[' + who + '] ') + color.yellow(formatDate()) + ' ' + msg);
}
var getLogMessage = function(uri, message, statusCode, request, response, inputType) {
//console.log(uri);
var _req = "\n" + clc.blue(S('-').repeat(60).s) + "\n";
_req += clc.blue("*") + clc.cyan(" SERVER REQUEST [" + clc.red(message) + "]") + "\n";
_req += clc.blue("*") + clc.cyan(" URL: ") + uri + "\n";
_req += clc.blue(S('-').repeat(60).s) + "\n";
var _res = clc.blue(S('-').repeat(60).s) + "\n";
_res += clc.blue("*") + clc.cyan(" SERVER RESPONSE [" + clc.red(message) + "]") + "\n";
_res += clc.blue("*") + clc.cyan(" STATUS CODE: ") + statusCode + "\n";
_res += clc.blue(S('-').repeat(60).s) + "\n";
if(inputType == 'json') {
_req += util.inspect(request, null, null, true) + "\n";
if(response instanceof Buffer) {
_res += response.toString() + "\n";
} else {
_res += util.inspect(response, null, null, true) + "\n";
}
} else {
_req += nxmlpp.strPrint(request);
var loading = function(m) {
if (myUtil.isString(m))
console.log("[" + clc.yellow("loading") + "] " + m);
else {
if (myUtil.equals(m.dependent, [cfg.builtin])) {
console.log("[" + clc.yellow("loading") + "] Module: " + clc.blue(m.name) + ", who depends on " + clc.blue(JSON.stringify([])));
console.log("[" + clc.green("builtin") + "] Begin to load Modules: " + clc.blue("builtin"));
} else
console.log("[" + clc.yellow("loading") + "] Module: " + clc.blue(m.name) + ", who depends on " + clc.blue(JSON.stringify(m.dependent)));
}
};
function logMsg(who, msg) {
console.log(color.blue('[' + who + '] ') + color.yellow(formatDate()) + ' ' + msg);
}
if (column != null) {
source += ', column' + column;
}
}
message = message ? [message, source].join(' ') : source;
}
switch (type) {
case 'error':
konsole.write(clc.red(id + ': ') + message);
break;
case 'warn':
konsole.write(clc.yellow(id + ': ') + message);
break;
case 'time':
konsole.write(clc.blue(id + ': ') + message);
break;
default:
konsole.write(id + ': ' + message);
break;
}
}