How to use the kleur.underline function in kleur

To help you get started, weā€™ve selected a few kleur 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 Hotell / typescript-lib-starter / scripts / init.js View on Github external
function modifyContents(config) {
  console.log(kleur.underline().white('Modified'))

  const files = modifyFiles.map((fileName) => resolve(ROOT, fileName))

  const replaceConfig = createTemplateVariablesConfig(files, config, [
    [
      /Martin\s+Hochel/g, // This is here only for LICENSE.md
      `${config.username} <${config.usermail}>`,
    ],
  ])

  try {
    const changedFiles = replace.sync(replaceConfig)

    log(kleur.yellow(changedFiles.join('\n')))
  } catch (reason) {
    error('An error occurred modifying the file: ', reason)
github lukeed / pwa / packages / cli / lib / build.js View on Github external
} else {
				// Get routes from file structure
				let cwd = ctx.options.resolve.alias['@pages'];
				if (fs.existsSync(cwd)) {
					let fmt = x => x.substring(0, x.indexOf('.')).toLowerCase().replace('index', '');
					routes = glob('**/*', { cwd }).map(fmt).map(slashes);
				}
			}

			if (routes) {
				routes.sort((a, b) => b.length - a.length); // root is last (TODO)
			} else {
				routes = ['/'];
				let msg = `Exporting the "${colors.bold().yellow('/')}" route only!\nNo other routes found or specified:`;
				msg += `\nā€“ Your ${colors.bold().italic('@pages')} directory is empty.`;
				if (ctx.PWA_CONFIG) msg += `\nā€“ Your ${colors.underline().magenta('pwa.config.js')} is missing a "${colors.bold('routes')}" key.`;
				msg += `\nā€“ Your ${colors.dim('$ pwa export')} is missing the ${colors.cyan('--routes')} argument.`;
				msg += `\n  Please run ${colors.dim('$ pwa export --help')} for more info\n`;
				log.warn(msg);
			}

			let fn;
			let onNoMatch = res => fn({ path:'/' }, res, r => (r.statusCode=404,r.end()));
			let server = createServer(fn=sirv(dest, { onNoMatch })).listen();

			// Disable sandboxing (on command) for dead-simple CI/CD/Docker integrations
			// @see https://developers.google.com/web/updates/2017/04/headless-chrome#faq
			let chromeFlags = ['--headless', '--disable-gpu'];
			if (opts.insecure) chromeFlags.push('--no-sandbox');

			let base = 'http://localhost:' + server.address().port;
			log.log(`Started local server on ${ colors.white().bold().underline(base) }`);
github decentralized-identity / element / packages / element-core / scripts / migrate / migrate-4-5.js View on Github external
const cpFiles = ['copy.js', 'file-size.js', 'build.js', 'tsconfig.json']
  /** @type {string[]} */
  const rmFiles = []
  const rmDirs = ['migrate']

  const cpItems = cpFiles.map((file) => join(starterPathDir, file))
  const rmItems = [...rmDirs, ...rmFiles].map((file) =>
    join(libPackagePathDir, file)
  )

  sh.cp('-Rf', cpItems, `${libPackagePathDir}/`)
  // 'rm' command checks the item type before attempting to remove it
  sh.rm('-Rf', rmItems)

  log(kleur.underline().white('==šŸ“ scripts/ updated āœ… =='))
  log(kleur.red('Removed: \n ' + rmItems.join('\n')))
  log(kleur.yellow('Copied: \n ' + cpItems.join('\n')))
}
github adonisjs / adonis-cli / index.ts View on Github external
kernel.flag('version', (value) => {
  if (!value) {
    return
  }

  dumpAsciiLogo()
  console.log(`CLI version:       ${yellow(underline(getCliVersion() || 'NA'))}`)
  console.log(`Framework version: ${yellow(underline(getAdonisCoreVersion(process.cwd()) || 'NA'))}`)
  process.exit(0)
}, {})
github vue-styleguidist / vue-styleguidist / packages / vue-styleguidist / src / scripts / binutils.ts View on Github external
export function commandHelp() {
	console.log(
		[
			kleur.underline('Usage'),
			'',
			'    ' +
				kleur.bold('styleguidist') +
				' ' +
				kleur.cyan('') +
				' ' +
				kleur.yellow('[]'),
			'',
			kleur.underline('Commands'),
			'',
			'    ' + kleur.cyan('build') + '           Build style guide',
			'    ' + kleur.cyan('server') + '          Run development server',
			'    ' + kleur.cyan('help') + '            Display React Styleguidist help',
			'',
			kleur.underline('Options'),
			'',
			'    ' + kleur.yellow('--config') + '        Config file path',
			'    ' + kleur.yellow('--open') + '          Open Styleguidist in the default browser',
			'    ' + kleur.yellow('--verbose') + '       Print debug information'
		].join('\n')
	)
}
github styleguidist / react-styleguidist / src / bin / styleguidist.js View on Github external
function printErrorWithLink(message, linkTitle, linkUrl) {
	console.error(`${kleur.bold().red(message)}\n\n${linkTitle}\n${kleur.underline(linkUrl)}\n`);
}
github styleguidist / react-styleguidist / src / bin / styleguidist.js View on Github external
function commandHelp() {
	console.log(
		[
			kleur.underline('Usage'),
			'',
			'    ' +
				kleur.bold('styleguidist') +
				' ' +
				kleur.cyan('') +
				' ' +
				kleur.yellow('[]'),
			'',
			kleur.underline('Commands'),
			'',
			'    ' + kleur.cyan('build') + '           Build style guide',
			'    ' + kleur.cyan('server') + '          Run development server',
			'    ' + kleur.cyan('help') + '            Display React Styleguidist help',
			'',
			kleur.underline('Options'),
			'',
			'    ' + kleur.yellow('--config') + '        Config file path',
			'    ' + kleur.yellow('--port') + '          Port to run development server on',
			'    ' + kleur.yellow('--open') + '          Open Styleguidist in the default browser',
			'    ' + kleur.yellow('--verbose') + '       Print debug information',
		].join('\n')
	);
}
github Hotell / typescript-lib-starter / scripts / migrate / migrate-4-5.js View on Github external
function updateConfigDir() {
  const starterPathDir = resolve(ROOT, 'config')
  const libConfigPathDir = resolve(PACKAGE_ROOT, 'config')

  /** @type {string[]} */
  const cpFiles = ['global.d.ts']
  /** @type {string[]} */
  const rmFiles = ['prettier.config.js']

  const cpItems = cpFiles.map((file) => join(starterPathDir, file))
  const rmItems = rmFiles.map((file) => join(libConfigPathDir, file))

  sh.cp('-Rf', cpItems, `${libConfigPathDir}/`)
  sh.rm('-Rf', rmItems)

  log(kleur.underline().white('==šŸ“ config/ updated āœ… =='))
  log(kleur.red('Removed: \n ' + rmItems.join('\n')))
  log(kleur.yellow('Copied: \n ' + cpItems.join('\n')))
}
github styleguidist / react-styleguidist / src / bin / styleguidist.js View on Github external
kleur.underline('Usage'),
			'',
			'    ' +
				kleur.bold('styleguidist') +
				' ' +
				kleur.cyan('') +
				' ' +
				kleur.yellow('[]'),
			'',
			kleur.underline('Commands'),
			'',
			'    ' + kleur.cyan('build') + '           Build style guide',
			'    ' + kleur.cyan('server') + '          Run development server',
			'    ' + kleur.cyan('help') + '            Display React Styleguidist help',
			'',
			kleur.underline('Options'),
			'',
			'    ' + kleur.yellow('--config') + '        Config file path',
			'    ' + kleur.yellow('--port') + '          Port to run development server on',
			'    ' + kleur.yellow('--open') + '          Open Styleguidist in the default browser',
			'    ' + kleur.yellow('--verbose') + '       Print debug information',
		].join('\n')
	);
}