
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
native-progress-bar
Advanced tools
This module allows your Electron app to display native dialogs with progress bars in them on Windows and macOS.
This module allows your Electron app to display native dialogs with progress bars in them on Windows and macOS.
It has no dependencies other than binding
and creates a ~85KB Node addon.
To see various examples for progress bars, check out test/src/progress-bars.js
.
On macOS, the module only works in Node.js environments that run within a proper application (like Electron).
It therefore does not run in simple Node.js scripts that you might execute with node myscript.js
.
import { ProgressBar } from "native-progress-bar"
let progressBar, interval;
// All arguments are optional
progressBar = new ProgressBar({
// Window title
title: "Running disk operation",
// Message, shown above the progress bar
message: "Running format C:",
// Initial progress value
progress: 0,
// Can be "hud", "utility", or "default". Only of effect on macOS.
style: "hud"
// Zero or more buttons
buttons: [{
label: "Cancel",
click: (progressBar) => {
console.log("Cancel button clicked");
progressBar.close();
}
}],
// A function called when the dialog is closed. Useful to cleanup intervals.
onClose: () => {
clearInterval(interval);
},
});
interval = setInterval(() => {
if (progressBar.progress >= 100) {
clearInterval(interval);
// You can dynamically change buttons
progressBar.buttons = [{
label: "Done",
click: (progressBar) => {
console.log("Done button clicked");
progressBar.close();
}
}]
return
}
progressBar.progress += 1;
}, 200);
I didn't need Linux but I'd welcome PRs implementing it there.
FAQs
This module allows your Electron app to display native dialogs with progress bars in them on Windows and macOS.
The npm package native-progress-bar receives a total of 177 weekly downloads. As such, native-progress-bar popularity was classified as not popular.
We found that native-progress-bar 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.