本文整理汇总了TypeScript中colors/safe.green函数的典型用法代码示例。如果您正苦于以下问题:TypeScript green函数的具体用法?TypeScript green怎么用?TypeScript green使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了green函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: numeral
server.listen(portNumber, () => {
var endTime = Date.now();
var elapsedTime = (endTime - startTime)/1000;
var t = numeral(elapsedTime).format('0.00');
console.log('\n');
console.log(colors.bgGreen(colors.white(' ')));
console.log(colors.bgGreen(colors.white(' Startup completead in ' + t + ' seconds. ')));
console.log(colors.bgGreen(colors.white(' ')));
console.log('\n');
console.log("Your application is in "+colors.green(server.get('env'))+" mode on port "+colors.green(portNumber));
if (onReadyCallback) onReadyCallback();
});
示例2: Date
configurationsAPI.saveConfigruation('installed', {installation_time: new Date()}, (err) => {
if (err) {
console.error(colors.red("Ops! Something goes wrong! Please, try again!"));
console.dir(err);
return;
}
var table = new Table({
head: [colors.green('\n Installation completed! \n')],
chars: tableBorders
});
console.log(table.toString());
});
示例3: Date
const downloadWallet = (wallet: SimpleWallet) => {
console.log(white(`\n\nDownloading wallet for your convenience.\n\nPlease store someplace safe. The private key is encrypted by your password.\n\nTo load this wallet on a new computer you would simply import the .wlt file into this app and enter your password and you'll be able to sign transactions.
`));
if (!fs.existsSync(PATH_HOME)) {
fs.mkdirSync(PATH_HOME);
}
let fullPath = PATH_WALLET;
if (fs.existsSync(fullPath)) {
const stamp = new Date().toISOString();
fullPath = `${PATH_HOME}/${stamp}-${MOSAIC_NAME}-wallet.wlt`
}
fs.writeFileSync(fullPath, wallet.writeWLTFile());
console.log(green(`Downloaded wallet to ${fullPath}`))
};
示例4: async
}, async (_, result) => {
if (result.password !== result.confirmPass) {
console.log(magenta('\nPasswords do not match.\n\n'));
createPwd();
} else {
/**
* Create new SimpleWallet
* Open it to access the new Account
* Print account info
*/
const wallet = createSimpleWallet(result.password);
const pass = new Password(result.password);
const account = wallet.open(pass);
const address = account.address.pretty();
console.log(green(`${MOSAIC_NAME} wallet successfully created.`));
console.log(white(`You can now start sending and receiving ${MOSAIC_NAME}!`));
console.log(white(`\n${MOSAIC_NAME} Public Address:`));
console.log(yellow(`${address}`));
console.log(white(`\nPrivate Key:`));
console.log(yellow(`${account.privateKey}`));
await downloadWallet(wallet);
}
})
示例5: passed
function passed (value, type) {
count++;
if (value) {
successful++;
} else {
failed++;
}
if(type==='sync'){
syncCount++;
if (value) {
syncSuccessful++;
} else {
syncFailed++;
}
}
if(type==='async'){
asyncCount++;
if (value) {
asyncSuccessful++;
} else {
asyncFailed++;
}
}
if(type==='cmdLine'){
cmdLineCount++;
if (value) {
cmdLineSuccessful++;
} else {
cmdLineFailed++;
}
}
return value ? colors.green('Passed') : colors.yellow('!!!!FAILED!!!!');
}
示例6: performConfiguration
function performConfiguration() {
var u = parameters.getParameter('install-user',null);
var p = parameters.getParameter('install-password',null);
if (u && p && u !== true && p !== true) {
return performInstall({
username: u,
password: p
});
}
var table = new Table({
head: [colors.green('\n Welcome to PortalTS! Please, create a new admin user \n')],
chars: tableBorders
});
console.log(table.toString());
askUserInfo((answers) => {
performInstall(answers);
});
}
示例7: execSync
}
// check if there are untracked changes
const gitStatus = execSync("git status", {cwd: rootDir, encoding: "utf8"});
if (/have diverged/.test(gitStatus)) {
if (!argv.dry) fail(colors.red("Cannot continue, the local branch has diverged from the git repo!"));
else console.log(colors.red("This is a dry run. The full run would fail due to a diverged branch\n"));
} else if (!/working tree clean/.test(gitStatus)) {
if (!argv.dry) fail(colors.red("Cannot continue, the local branch has uncommited changes!"));
else console.log(colors.red("This is a dry run. The full run would fail due to uncommited changes\n"));
} else if (/Your branch is behind/.test(gitStatus)) {
if (!argv.dry) fail(colors.red("Cannot continue, the local branch is behind the remote changes!"));
else console.log(colors.red("This is a dry run. The full run would fail due to the local branch being behind\n"));
} else if (/Your branch is up\-to\-date/.test(gitStatus) || /Your branch is ahead/.test(gitStatus)) {
// all good
console.log(colors.green("git status is good - I can continue..."));
}
const releaseTypes = ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease"];
const releaseType = argv._[0] || "patch";
let newVersion = releaseType;
const oldVersion = pack.version as string;
if (releaseTypes.indexOf(releaseType) > -1) {
if (releaseType.startsWith("pre") && argv._.length >= 2) {
// increment to pre-release with an additional prerelease string
newVersion = semver.inc(oldVersion, releaseType, argv._[1]);
} else {
newVersion = semver.inc(oldVersion, releaseType);
}
console.log(`bumping version ${colors.blue(oldVersion)} to ${colors.gray(releaseType)} version ${colors.green(newVersion)}\n`);
示例8:
res.removedStaged.forEach(v => log.log(` ${colors.green('removed:')} ${v}`));