Là một công cụ cho lập trình viên, privatenumber/tasuku đã đạt 2.2k sao trên GitHub, ngôn ngữ TypeScript. ✅ タスク — The minimal task visualizer for Node.js
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Found this package useful? Show your support & appreciation by sponsoring! ❤️
Install
npm i tasuku
About
タスク (Tasuku) is a minimal task runner for Node.js. You can use it to label any task/function so that its loading, success, and error states are rendered in the terminal.
For example, here's a simple script that copies a file from path A to B.
import { copyFile } from 'node:fs/promises'
import task from 'tasuku'
task('Copying file from path A to B', async ({ setTitle }) => {
await copyFile('/path/A', '/path/B')
setTitle('Successfully copied file from path A to B!')
})
Running the script will look like this in the terminal:
Usage
Task list
Call task(taskTitle, taskFunction) to start a task and display it in a task list in the terminal.
You can run tasks in parallel by passing in { concurrency: n } as the second argument in task.group().
const api = await task.group(task => [
task(
'Task 1',
async () => await someAsyncTask()
),
task(
'Task 2',
async () => await someAsyncTask()
)
// ...
], {
concurrency: 2 // Number of tasks to run at a time
})
api.clear() // Clear output
Alternatively, you can also use the native Promise.all() if you prefer. The advantage of using task.group() is that you can limit concurrency, displays queued tasks as pending, and it returns an API to easily clear the results.
type TaskAPI = {
// Result from taskFunction
result: unknown
// State of the task
state: 'error' | 'warning' | 'success'
// Warning message if state is 'warning', otherwise undefined
warning: string | undefined
// Error message if state is 'error', otherwise undefined
error: string | undefined
// Invoke to clear the results from the terminal
clear: () => void
}
The task function. The return value will be stored in the .result property of the task() output object.
task
A task function to use for nesting.
setTitle()
Call with a string to change the task title.
setStatus()
Call with a string to set the status of the task.
setOutput()
Call with a string to set the output of the task.
streamPreview
A Writable stream for displaying live output below the task. Pipe a child process or any readable stream into it to show a scrolling preview of the output.
Handles both \n (newline) and \r (carriage return) — programs like curl that use \r for in-place progress bars work out of the box.
By default, shows the last 5 lines. Use the previewLines option to change this. When there are more lines than the limit, a (+ N lines) indicator is shown.
[!NOTE]
setOutput() and streamPreview render independently. If both are used, static output appears above the stream preview.
setWarning()
Call with a string or Error instance to put the task in a warning state. Call with no argument (or a falsy value) to revert to loading state.
setError()
Call with a string or Error instance to put the task in an error state. Call with no argument (or a falsy value) to revert to loading state. Tasks automatically go into an error state when it catches an error in the task.
startTime()
Start or restart the elapsed time counter. Calling again resets to 0. Time is displayed after the status: ⠋ Task [status] (3s)
stopTime()
Stop the elapsed time counter and return the elapsed milliseconds. The displayed time freezes at the stopped value. Useful for profiling task phases.
Type: { showTime?: boolean, previewLines?: number }
Optional task options.
previewLines
Type: number
Default: 5
Maximum number of lines to display in the streamPreview output (minimum 1). When the stream produces more lines, older lines scroll off and a (+ N lines) indicator shows the total.
showTime
When true, automatically starts the elapsed time counter when the task begins. Equivalent to calling startTime() at the start of the task function.
Format: (Xs) for under a minute, (Xm Ys) for under an hour, (Xh Ym) for longer
Not shown if elapsed < 1 second
Freezes at final value when task completes
task.group(createTaskFunctions, options)
Returns a Promise that resolves with object:
// The results from the taskFunctions
type TaskGroupAPI = {
// Result from taskFunction
result: unknown
// State of the task
state: 'error' | 'warning' | 'success'
// Invoke to clear the task result
clear: () => void
}[] & {
// Invoke to clear ALL results
clear: () => void
}
createTaskFunctions
Type: (task) => Task[]
Required: true
A function that returns all the tasks you want to group in an array.
options
Directly passed into p-map.
concurrency
Type: number (Integer)
Default: 1
Number of tasks to run at a time.
stopOnError
Type: boolean
Default: true
When set to false, instead of stopping when a task fails, it will wait for all the tasks to finish and then reject with an aggregated error containing all the errors from the rejected promises.
maxVisible
Type: number | ((terminalHeight: number) => number)
Default: Responsive to terminal height (rows - 2, minimum 5)
Maximum number of lines to display in the task list. When there are more task lines than this limit, remaining tasks are hidden with a state breakdown (e.g., "(+ 3 loading, 5 queued, 4 completed)"). Active tasks are always prioritized over pending and completed ones. This accounts for nested subtasks which add extra lines.
Can be a fixed number or a function called on each render for responsive limits.
By default, the limit is automatically lifted when all tasks complete and .clear() is called, revealing the full list.
Tasuku or タスク is the phonetic Japanese pronounciation of the word "task".
Why did you make this?
I built Tasuku as a lightweight task runner for scripts and CLI tools. It's designed to show task progress clearly without forcing a rigid structure on how you write your code.
Big thanks to listr and listr2, which inspired both the visuals and the idea—I've relied on them for years. But over time, I found their declarative approach too restrictive for my workflow, so I created something simpler and more flexible.
Tasuku uses its own minimal ANSI-based renderer for terminal output, giving you smooth console.log() integration with zero runtime dependencies. The rendering model was originally inspired by ink's approach to terminal UIs.
Doesn't the usage of nested task functions violate ESLint's no-shadow?
Yes, but it should be fine as you don't need access to other task functions aside from the immediate one.
privatenumber/tasuku thuộc nhóm Developer Tools trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về privatenumber/tasuku ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/privatenumber/tasuku là nguồn chính thức.
privatenumber/tasuku có bao nhiêu sao?
privatenumber/tasuku có 2.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/privatenumber/tasuku. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
privatenumber/tasuku có phải mã nguồn mở không?
Có — privatenumber/tasuku phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/privatenumber/tasuku.
privatenumber/tasuku có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho privatenumber/tasuku. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
privatenumber/tasuku là gì?
privatenumber/tasuku (privatenumber/tasuku) là dự án TypeScript trên GitHub. Theo mô tả gốc: ✅ タスク — The minimal task visualizer for Node.js
privatenumber/tasuku so với các dự án Developer Tools khác thế nào?
privatenumber/tasuku được TopGit xếp vào nhóm Developer Tools, với 2.2k sao GitHub và viết bằng TypeScript. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc tasuku có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về tasuku.