![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@yetnt/progressbar
Advanced tools
A progress bar creator in javascript typescript!
NOTE: All examples and explanations are in javascript.
npm install @yetnt/progressbar
sudo npm install @yetnt/progressbar
yarn add @yetnt/progressbar
const { progressBar, ProgressBar } = require('@yetnt/progressbar')
progressBar(percentage, barWidth, emptyChar, fullChar, returnAr?, firstEdgeOverride?, lastEdgeOverride?)
percentage = 45 // How much of the bar is full. If 100% the whole thing is full. If 0 everything is empty.
barWidth = 10 // Width of the bar. If 10 it's 10 characters long
emptyChar = "□" // Empty character to display for parts of the bar that aren't filled.
fullChar = "■" // Full character to display for parts of the bar that are filled.
returnAr = false // (optional) Return an array or not
firstEdgeOverride = ["◁", "◀"] // (optional) Overrides the first edge with the elements
lastEdgeOverride = ["▷", "▶"] // (optional) Overrides the last edge with elements
// This is exactly the same for class, but returnAr is not a parameter
let bar = new ProgressBar(percentage, barWidth, emptyChar, fullChar, firstEdgeOverride?, lastEdgeOverride?)
or if you don't want to deconstruct them (for some reason)
const pb = require("@yetnt/progressbar");
pb.progressBar();
// or
new pb.ProgressBar();
progressBar(45, 10, "□", "■");
let bar = new ProgressBar(45, 10, "□", "■");
bar.bar;
"■■■■□□□□□□";
progressBar(45, 10, "□", "■", true);
let bar = new ProgressBar(45, 10, "□", "■", true);
bar.barArray;
["■", "■", "■", "■", "□", "□", "□", "□", "□", "□"];
If you'd like you can also change the first bar element and the last bar element so you can edge it with emojis or something else.
["emptyChar", "filledChar"];
progressBar(56, 30, "▢", "▧", false, ["◁", "◀"], ["▷", "▶"]);
let bar = new ProgressBar(56, 30, "▢", "▧", ["◁", "◀"], ["▷", "▶"]);
bar.bar;
"◀▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▢▢▢▢▢▢▢▢▢▢▢▢▢▷";
Code may need to be modified depending on your command handler, currently setup using ic4d Command Handler/(Under Ctrl's Command Handler)
const { ProgressBar, progressBar } = require("@yetnt/progressbar"); // deconstructing
module.exports = {
name: "progressbar",
description: "useful npm package made by yet",
callback: async (client, interaction) => {
const progressBar = new ProgressBar(55, 10, "▢", "▧");
interaction.reply({
content: progressBar.bar,
ephemeral: true,
});
},
};
Unlike the function, If you update any one of the properties of the ProgessBar object, the bar updates.
let bar = new ProgressBar(56, 30, "▢", "▧", ["◁", "◀"], ["▷", "▶"]);
bar.bar; // ◀▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▢▢▢▢▢▢▢▢▢▢▢▢▢▷
bar.barWidth = 20;
bar.bar; // ◀▧▧▧▧▧▧▧▧▧▧▢▢▢▢▢▢▢▢▷
bar.percentage = 80;
bar.bar; // ◀▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▢▢▢▷
bar.firstEdgeOverride = [];
bar.lastEdgeOberride = [];
bar.bar; // ▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▢▢▢▢ (Removes Edge Overrides)
Warning : Bar may not work properly if you edit any other properties that aren't meant to be edited. (these tend to be properties with an _)
To seprate a bar with some value (Replace the last filled char), you can use the charSplit()
method.
let bar = new ProgressBar(56, 30, "▢", "▧");
bar.bar; // ▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▢▢▢▢▢▢▢▢▢▢▢▢▢▢
bar.charSplit("▶");
bar.bar; // ▧▧▧▧▧▧▧▧▧▧▧▧▧▧▧▶▢▢▢▢▢▢▢▢▢▢▢▢▢▢
The bar will NOT charSplit if :
Last Edge Override is provided
AND
Bar's percentage is 100%
FAQs
An easy, simple and customizable string progress bar
We found that @yetnt/progressbar 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.