
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
tasktree-cli
Advanced tools
Simple terminal task tree - helps you keep track of your tasks in a tree structure.
Simple terminal task tree - helps you keep track of your tasks in a tree structure.
npm install tasktree-cli
import TaskTree from 'tasktree-cli';
const tree = TaskTree.tree();
// start task tree log update in terminal
tree.start();
// create tasks
const task1 = tree.add('{underline Task {bold #1}}');
const task2 = tree.add('Task {bold #2}');
const task3 = task2.add('Subtask...');
const tpl = ':bar :rate/bps {cyan.bold :percent} :etas';
// create progress bars
const bars = [task3.bar(tpl), task3.bar(tpl), task3.bar(tpl)];
// ... whatever
let once = false;
const promises = [50, 75, 200].map((ms, i) => {
return new Promise(resolve => {
const handle = setInterval(() => {
const bar = bars[i];
if (bar) {
if (once) {
if (bar.percent >= 50) {
bar.skip();
} else {
bar.fail();
}
} else {
once = bar.tick(Math.random() * 10).isCompleted;
}
}
if (once) {
clearInterval(handle);
resolve('');
}
}, ms);
});
});
Promise.all(promises).then(() => {
// skip task
task3.skip('Subtask skipped');
// log info message in Task #2, complete task
task2.log('Informational message').complete();
// log warning and error in Task #1, fail it
task1.warn('Warning message').error(new Error('Something bad happened'), true);
// stop task tree log update
tree.stop();
});
TaskTree uses chalk-template to style text and supports formatting as a tagged template literal:
const task = new Task('{underline.cyan.bold Awesome task}');
If you are using braces in a formatted string, use \\
to escape it:
const task = new Task('{underline.cyan.bold \\{Awesome\\} task}');
Read the API documentation for more information.
FAQs
Simple terminal task tree - helps you keep track of your tasks in a tree structure.
The npm package tasktree-cli receives a total of 632 weekly downloads. As such, tasktree-cli popularity was classified as not popular.
We found that tasktree-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.