Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@ms-cloudpack/task-reporter
Advanced tools
A library for standardizing how tasks are logged to the console.
const taskReporter = new TaskReporter({
productName: `Foobar`,
version: `1.2.3`,
description: `running tasks with ${bold(`15`)} workers`,
showStarted: false,
showPending: true,
showCompleted: true,
showSummary: true,
showTaskDetails: true,
});
runTask
method:await taskReporter.runTask(`build something`, async () => {
// ...do async things.
return {
status: 'fail' // default: 'complete'
message: 'optional message',
details: 'optional details',
extended: 'optional debugging info'
}
});
2b. For tasks that may not be easily encapsulated within a wrapper function, you can use the addtask
method:
const task = taskReporter.addTask(`build something`, /* initially idle */ true);
// When you are starting the task, you can call start:
try {
task.start();
} finally {
task.complete({ status: 'complete' /* etc */ });
}
// Fail example, with provide details:
import { bulletedList } from '@ms-cloudpack/task-reporter';
task.complete({
status: 'fail',
message: 'Reason',
details: bulletedList(['Name: value', 'Errors:', ['sub-bullet things', 'etc'], 'Warnings', ['warn1', etc]]),
});
For formatting details, a variety of style helpers can be imported.
import { cyan, bold, red } from '@ms-cloudpack/task-reporter';
task.complete('fail', { message: cyan(bold(`I am an ${red(`error`)}`)) });
reporter.complete('reason')
to end task logging:// You can instruct the reporter to complete when all tasks are done.
reporter.completeWhenTasksDone();
// Or, you can manually tell it to complete at any point. For example, you may want to complete things when the
// users hits ctrl-c. Prematurely completing means pending tasks will be skipped and running tasks will be aborted.
process.on('SIGINT', () => {
reporter.complete('User hit Ctrl-C');
});
FAQs
Helpers for logging tasks to the console.
The npm package @ms-cloudpack/task-reporter receives a total of 773 weekly downloads. As such, @ms-cloudpack/task-reporter popularity was classified as not popular.
We found that @ms-cloudpack/task-reporter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.