How to use the undertaker function in undertaker

To help you get started, we’ve selected a few undertaker 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 microsoft / just / packages / just-task / src / undertaker.ts View on Github external
import Undertaker from 'undertaker';
import { logger } from './logger';
import chalk from 'chalk';
import { wrapTask } from './wrapTask';
import { Task } from './interfaces';
import { clearCache } from './cache';

const undertaker = new Undertaker();
const NS_PER_SEC = 1e9;

let topLevelTask: string | undefined = undefined;
let errorReported = false;
const tasksInProgress: { [key: string]: boolean } = {};

const colors = [chalk.cyanBright, chalk.magentaBright, chalk.blueBright, chalk.greenBright, chalk.yellowBright];
const taskColor: { [taskName: string]: number } = {};
let colorIndex = 0;

function shouldLog(taskArgs: any) {
  return (
    !taskArgs.branch &&
    taskArgs.name !== '' &&
    !taskArgs.name.endsWith('?') &&
    taskArgs.name !== '_wrapFunction' &&

undertaker

Task registry that allows composition through series/parallel methods.

MIT
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis