How to use the log-update.done function in log-update

To help you get started, we’ve selected a few log-update 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 dematerializer / emoji-finder / src / cli.js View on Github external
const store = createStore(rootReducer, applyMiddleware(sagaMiddleware));

// Set emoji data:

const languageFromEnv = (process.env.LANG || 'en').split('.')[0].split('_')[0];
const languageFromArgs = cli.flags.dango ? 'en' : cli.input[0];
let language = languageFromArgs || languageFromEnv;

if (!['en', 'de'].includes(language)) {
	logUpdate(`⌨ ${language} not upported, using en`);
	logUpdate.done();
	language = 'en';
} else {
	logUpdate(`⌨ ${language}`);
	logUpdate.done();
}

const data = getDataForLanguage(language);

sagaMiddleware.run(inputEmojiSequenceSubmitted);

if (cli.flags.dango) {
	sagaMiddleware.run(currentQueryChanged, data); // data still needed for annotations!
} else {
	store.dispatch(setFindSuggestedEmoji(createSelectSuggestedEmojiForQuery(data)));
}

// Render once initially and every time the store changes:

const render = () => logUpdate(selectStyledInput(store.getState()));
// const render = () => {
github dematerializer / unicode-emoji-data / src / build-emoji-data.js View on Github external
getNameForCodepoint: unicodeData.getNameForCodepoint,
		getVariationSequencesForCodepoint: standardizedVariants.getVariationSequencesForCodepoint,
		getCombinationsForCodepoint: emojiSequences.getCombinationsForCodepoint,
		getShiftJisCodesForCodepoint: emojiSources.getShiftJisCodesForCodepoint,
	});
	logUpdate('✓ emoji-data');
	logUpdate.done();

	logUpdate('⇣ emoji-zwj-sequences');
	const emojiZwjSequences = yield buildEmojiZwjSequences({
		url: preset.emojiZwjSequencesUrl,
		getNameForCodepoint: unicodeData.getNameForCodepoint,
		getMetaForModifierName: emojiData.getMetaForModifierName,
	});
	logUpdate('✓ emoji-zwj-sequences');
	logUpdate.done();

	// Render emoji data file containing compact, nested emoji data:

	logUpdate('⇣ write data file');

	const combined = [
		...emojiData.emoji,
		...emojiSequences.flagEmoji,
		...emojiZwjSequences.zwjEmoji,
	];
	fs.writeFileSync('res/emoji-data.json', JSON.stringify(combined, null, 2));

	logUpdate('✓ write data file');
	logUpdate.done();

	// Create temporary expanded human readable emoji data containing flattened
github jsayol / FireSQL / tools / test-data / task-list.ts View on Github external
function done(result?: string) {
  clearInterval(interval);

  let log = chalk`{green {bold \u2713}} ${task}`;

  if (result !== void 0) {
    log += chalk` {grey ${result}}`;
  }

  logUpdate(log);
  logUpdate.done();
  interval = null;
  task = '';
}
github KishanBagaria / padding-oracle-attacker / src / logging.ts View on Github external
export function logError(err: Error) {
  logUpdate.done()
  console.error(chalk.red(err.stack || err.message))
}
github dematerializer / unicode-emoji-data / src / check-annotations.js View on Github external
const numSequencesMissingTtsCoveredByCommunity = result.sequencesMissingAnnotations.filter(datum => datum.tts === 'covered').length;
		const numSequencesMissingKeywordsCoveredByCommunity = result.sequencesMissingAnnotations.filter(datum => datum.keywords === 'covered').length;
		if (numSequencesMissingTts > 0 || numSequencesMissingKeywords > 0) {
			logUpdate(`x check-annotations ${result.language}:`);
			logUpdate.done();
			if (numSequencesMissingTts > 0) {
				logUpdate(`  ${numSequencesMissingTts} sequences missing tts (${numSequencesMissingTtsCoveredByCommunity} covered by community)`);
				logUpdate.done();
			}
			if (numSequencesMissingKeywords > 0) {
				logUpdate(`  ${numSequencesMissingKeywords} sequences missing keywords (${numSequencesMissingKeywordsCoveredByCommunity} covered by community)`);
				logUpdate.done();
			}
			fs.writeFileSync(`./lib/annotations/coverage/${result.language}.json`, JSON.stringify(result.sequencesMissingAnnotations, null, 2));
			logUpdate(`  coverage report saved`);
			logUpdate.done();
			return false;
		}
		logUpdate(`✓ check-annotations ${result.language}`);
		logUpdate.done();
		return prevSuccess;
	}, true);
	logUpdate(`${success ? '✓' : 'x'} check-annotations`);
github alex-phillips / node-clouddrive / lib / Logger.js View on Github external
static debug(message, data = null, callback = null) {
    logUpdate.clear();
    Logger.getInstance().debug(message, data, callback);
    logUpdate.done();
  }
github Financial-Times / origami-build-tools / lib / helpers / listr-renderer.js View on Github external
end(err) {
		if (this._id) {
			clearInterval(this._id);
			this._id = undefined;
		}

		render(this._tasks, this._options);

		if (this._options.clearOutput && err === undefined) {
			logUpdate.clear();
		} else {
			logUpdate.done();
		}
	}
}

log-update

Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc.

MIT
Latest version published 4 months ago

Package Health Score

80 / 100
Full package analysis