How to use the chalk.magenta function in chalk

To help you get started, we’ve selected a few chalk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coodoo / flowery / flowery.js View on Github external
${invoke.errFile}, line ${invoke.errNumLine}
			${invoke.errLine}
			${spaces}${'↑ expecting'} ${receive.errType}, got ${invoke.errType}

			  From:
			  ${receive.errFile}, line ${receive.errNumLine}
			  ${receive.errLine}
		`;

	} else if ( invoke && !receive ) {

		// invoke = parseLine(arr[0]);

		template = `
			${chalk.magenta.bold( '> Error:' )}
			  ${invoke.errFile}, line ${chalk.magenta( invoke.errNumLine )}
			  ${invoke.errLine}
			  ${chalk.white( '↑' )} ${chalk.white( msg )}
		`;
	}

	result = template.replace( /\t/gi, '' );

	// console.log( '\n\nmsg: ', result );

	return result;
}
github swashata / wp-webpack-script / packages / scripts / src / config / getProjectAndServerConfig.ts View on Github external
);
	// Now create the configuration objects
	let serverConfig: ServerConfig;

	try {
		// eslint-disable-next-line global-require
		serverConfig = require(serverConfigPath) as ServerConfig;
	} catch (e) {
		throw new WpackioError(
			`Could not find server configuration at:\n${chalk.dim(
				serverConfigPath
			)}\nPlease make sure the file exists\nor adjust your ${chalk.yellow(
				'--context'
			)} or ${chalk.yellow(
				'--server-config'
			)} parameters.\nIf this is your first time, try running\n${chalk.magenta(
				`${isYarn() ? 'yarn' : 'npm run'} bootstrap`
			)}`
		);
	}

	// Validate them
	validateServerConfig(serverConfig);

	return {
		serverConfig: { ...serverConfigDefault, ...serverConfig },
		serverConfigPath,
	};
}
github nesk / network.js / gulpfile.js View on Github external
watcher.on('change', function(event) {
        var type = event.type.toUpperCase().slice(0, 1) + event.type.toLowerCase().slice(1);
        console.log('\n' + chalk.yellow(type + ': ') + chalk.magenta(event.path) + '\n');
    });
});
github rafaelkallis / ticket-tagger / src / classifier.js View on Github external
console.log(magenta(`run ${i + 1}/${folds} finished`));
  }
  console.log(bgMagenta("  stats  "));
  console.log(
    magenta("accuracy: "),
    mean(measures.map(m => m.accuracy)).toFixed(3)
  );

  for (const label of ["bug", "enhancement", "question"]) {
    console.log(bgMagenta(`   ${label}   `));
    console.log(
      magenta("precision: "),
      mean(measures.map(m => m[label].precision)).toFixed(3)
    );
    console.log(
      magenta("recall: "),
      mean(measures.map(m => m[label].recall)).toFixed(3)
    );
    console.log(
      magenta("f1 score: "),
      mean(measures.map(m => m[label].f1)).toFixed(3)
    );
  }
}
exports.benchmark = benchmark;
github alibaba / ice / tools / ice-scripts / lib / utils / validationSassAvailable.js View on Github external
module.exports = function () {
  try {
    const sassInfo = require('node-sass').info;
    console.log('sassInfo', sassInfo);
  } catch (err) {
    console.error(err.message);
    console.log('');
    console.log(colors.red('Error:'), 'ice-scripts 已终止');
    console.log(colors.green('Info:'), '当前 node-sass 无法运行');
    console.log(colors.green('Info:'), '您可以尝试执行以下命令重装修复:');
    console.log('    ', colors.magenta('npm install node-sass'));
    console.log('');
    throw err;
  }
};
github JKHeadley / appy-backend / server / api / user.js View on Github external
(function () {
        const Log = logger.bind(Chalk.magenta("Enable Account"));
        const User = mongoose.model('user');

        const collectionName = User.collectionDisplayName || User.modelName;

        Log.note("Generating Enable Account endpoint for " + collectionName);

        const enableAccountHandler = function (request, reply) {

            const _id = request.params._id;

            return RestHapi.update(User, _id, { isEnabled: true }, Log)
                .then(function (user) {

                    if (!user) {
                        return reply(Boom.notFound('Document not found. That is strange.'));
                    }
github sumanjs / suman / lib / cli-commands / init-opt / index.js View on Github external
logPermissonsAdvice();
    }
    var err;
    try {
        require(path.resolve(projectRoot + '/package.json'));
    }
    catch (err) {
        if (!fforce) {
            _suman.log.info(' => Suman message => there is no package.json file in your working directory.');
            _suman.log.info(' => Perhaps you wish to run ' + chalk.yellow('"$ npm init"') + ' first, or perhaps you are in the wrong directory?');
            _suman.log.info(' => To override this use the --fforce option.');
            if (projectRoot) {
                _suman.log.info('\nIn other words, the current working directory is as follows:');
                _suman.log.info(chalk.cyan(cwd));
                _suman.log.info('...but the root of your project appears to be at this path:');
                _suman.log.info(chalk.magenta(projectRoot), '\n\n');
            }
            return;
        }
    }
    var resolved = false;
    var resolvedLocal = false;
    var pkgDotJSON;
    try {
        require.resolve('suman');
        resolved = true;
        pkgDotJSON = require(path.resolve(projectRoot + '/node_modules/suman/package.json'));
        resolvedLocal = true;
    }
    catch (e) {
        err = e;
    }
github FormidableLabs / builder-init / lib / init.js View on Github external
data: ["download", function (results, cb) {
      process.stdout.write(
        bin + " Preparing templates for: " + chalk.magenta(task.modName) + "\n"
      );

      prompts({
        init: results.download.data,
        defaults: opts.prompts,
        src: results.download.src
      }, cb);
    }],
github frctl / fractal / src / commands / welcome.js View on Github external
_.forEach(commands, command => {
                const description = command.opts && command.opts.description ? command.opts.description : '';
                usage += `
${chalk.magenta(_.padEnd(command.name, longest + 2))}${description}`;
            });
            usage += '\n';