How to use the kleur.inverse 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 kyonenjs / udeguchi / src / search.js View on Github external
course_found = await find_course_multi_requests(subscribed_url, headers, course_url_name);

				console.log(`  ${green_bg('Done')}`);
				clearTimeout(check_spinner.stop);

				if (!course_found) {
					handle_error('You do not own this course');
				}
			}
		}

		const course_path = create_course_folder(course_url_name);
		download_course_contents(course_found['id'], headers, course_path);
	} catch (error) {
		if (error['statusCode'] === 403) {
			console.log(`  ${red(inverse(' Fail '))}\n\n`);

			// If user provide username and password
			// maybe 403 error because your cached cookie is not valid anymore
			// try to login with username and password again
			if (commander.username && commander.password) {
				const auth_headers = await login_with_username_password(
					commander.username,
					commander.password
				);

				return find_owned_course(extract_course_name(commander.args[0]), auth_headers);
			}

			handle_error('Cookie is not valid');
		} else if (error['message'].includes('Cannot read property')) {
			handle_error('Course URL is not valid');
github lukeed / webpack-format-messages / index.js View on Github external
.replace('Cannot resolve module ', '')
				.replace('Error: ', '')
				.replace('[CaseSensitivePathsPlugin] ', '')
		];
	}

	// Cleans up syntax error messages.
	if (lines[1].startsWith('Module build failed: ')) {
		lines[1] = lines[1].replace('Module build failed: SyntaxError:', errorLabel);
	}

	if (lines[1].match(exportRegex)) {
		lines[1] = lines[1].replace(exportRegex, "$1 '$4' does not contain an export named '$3'.");
	}

	lines[0] = colors.inverse(lines[0]);

	// Reassemble & Strip internal tracing, except `webpack:` -- (create-react-app/pull/1050)
	return lines.join('\n').replace(stackRegex, '').trim();
}
github kyonenjs / udeguchi / src / references.js View on Github external
const url = require('url');
const {red, inverse} = require('kleur');
const commander = require('commander');

if (!commander.args[0]) {
	console.log(`\n${inverse(red(' Error '))} Missing course URL`);
	process.exit();
} else if (!commander.args[0].match(/(?:^https:\/\/)(.+)(?:\.udemy\.com\/.+)/i)) {
	console.log(`\n${inverse(red(' Error '))} Course URL is not valid`);
	process.exit();
}

let sub_domain = url.parse(commander.args[0].toLowerCase())['hostname'].match(/(^.+)(?:\.udemy\.com)/);

if (!sub_domain) {
	console.log(`\n${inverse(red(' Error '))} Course URL is not valid`);
	process.exit();
}

sub_domain = sub_domain[1];

const headers = {
github kyonenjs / udeguchi / src / download_assets.js View on Github external
res.on('end', () => {
					if (asset_size > 100000 || !asset_size) {
						fs.rename(downloading_asset_name_with_path, asset_name_with_path, (error) => {
							if (error) {
								handle_error(`Unable to rename asset ${yellow(asset_name)}`);
							}
						});
					}

					is_ebook
					? console.log(`\n  ${magenta().inverse(' Lecture ')}  ${asset_name}  ${green_bg('Done')}`)
					: console.log(`\n    ${gray(inverse(' Asset '))}  ${asset_name}  ${green_bg('Done')}`);
					resolve('Finish');
				});
			})
github vue-styleguidist / vue-styleguidist / packages / vue-styleguidist / src / scripts / binutils.ts View on Github external
function printStatus(text: string, type: MessageType) {
	if (type === 'success') {
		console.log(kleur.inverse.bold.green(' DONE ') + ' ' + text)
	} else if (type === 'error') {
		console.error(kleur.inverse.bold.red(' FAIL ') + ' ' + kleur.red(text))
	} else {
		console.error(kleur.inverse.bold.yellow(' WARN ') + ' ' + kleur.yellow(text))
	}
}
github styleguidist / react-styleguidist / src / bin / styleguidist.js View on Github external
function printStatus(text, type) {
	if (type === 'success') {
		console.log(
			kleur
				.inverse()
				.bold()
				.green(' DONE ') +
				' ' +
				text
		);
	} else if (type === 'error') {
		console.error(
			kleur
				.inverse()
				.bold()
				.red(' FAIL ') +
				' ' +
				kleur.red(text)
		);
	} else {
github decentralized-identity / element / packages / element-core / scripts / migrate / migrate-4-5.js View on Github external
log(kleur.italic('Migration initialized 👀...'))

  log(kleur.gray('path to Package:'), PACKAGE_ROOT)

  updatePackageJson()
  updateTsConfig()
  updateTsLintConfig()
  updateRcFiles()
  updatePrettier()
  updateConfigDir()
  updateScriptsDir()
  updateVSCodeDir()

  log(kleur.cyan('DONE ✅'))
  log(kleur.inverse().cyan('Make sure run yarn, to update yarn.lock 🤙'))
}
github kyonenjs / udeguchi / src / utilities.js View on Github external
const err_msg = msg => `${inverse(red(' Error '))} ${msg}`;
github Hotell / typescript-lib-starter / scripts / migrate / migrate-4-5.js View on Github external
log(kleur.italic('Migration initialized 👀...'))

  log(kleur.gray('path to Package:'), PACKAGE_ROOT)

  updatePackageJson()
  updateTsConfig()
  updateTsLintConfig()
  updateRcFiles()
  updatePrettier()
  updateConfigDir()
  updateScriptsDir()
  updateVSCodeDir()

  log(kleur.cyan('DONE ✅'))
  log(kleur.inverse().cyan('Make sure run yarn, to update yarn.lock 🤙'))
}