Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.