
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
dbd.js-utils
Advanced tools
What does it do?
Example
.parseToMS("3d10m3M") // can be declared as 3 Months, 3 days, 10 Minutes
Example
.parseMS(345840000) // 3 and 1 Days, 4 minutes
Output
{
second:0,
minute:4,
hour:0,
day:4,
month:0,
year:0
}
maxSeconds will be divided by AmountOfBars to create the divider, then SubstractSeconds will subtract maxSeconds and will be divided by divider, the results will create a Filled Bar marked with FilledSymbol, if addMarker is given, it will add it to the end of Filled Bar, then the amount of Filled Bar will substract AmountOfBars to get the Unfilled bars that will be filled with UnfilledSymbol.
Example
.progressBar(102, 315, 10, "📀", "―", "―")
Output
――――📀―――――
Example
.formatDate(1613374163494, "day, dd mmm yyyy", "UTC")
Output
Monday, 15 Feb 2021
List of Formats
| Format | Description | Output |
|---|---|---|
| YYYY | Gets the Full Year of date | 2021 |
| YY | Gets the last 2 digits of Full Year | 21 |
| DDD | Gets the Abbreviation of Day of the Week | Mon |
| DAY | Gets the Name of Day of the Week | Monday |
| DD | Gets the Day Date in Month of date | 15 |
| D | Gets the Number Day of the Week | 2 |
| MMM | Gets the Month Abbreviation | Feb |
| MONTH | Gets the Month Name of date | February |
| MM | Gets the Month of date | 2 |
| HOUR | Gets the Amount of Hour of date | 7 |
| MIN | Gets the Amount of Minutes of date | 37 |
| SEC | Gets the Amount of Seconds of date | 37 |
Example
.toMusicDuration(288000)
Output
4:48
Example
const dbdUtil = require("dbd.js-utils")
const Collection = new dbdUtil.Collection()
You can use Object or Array to create a Starting Data (Keys and Values)
new dbdUtil.Collection([["User", "Kino"], ["myId", 123]]) // Array
new dbdUtil.Collection({User:"Kino", myId:123}) // Object
Example
const bot = new dbd.Bot({
//DBD.JS Options
})
const CommandHandler = new dbdUtil.CommandHandler(bot)
CommandHandler.handle("./commands") // ./commands is a path
Can't see a possibility to reload commands? Wrong, you can!
We added an extra property for you to use the CommandHandler
$djsEval[
client.CommandHandler
//Reloading the Commands (path will be automatic if you have used it)
client.CommandHandler.handle()
//with Path
client.CommandHandler.handle("./commands")
//or if something went wrong
client.CommandHandler.handle(`${process.cwd()}/commands`)
]
This can also change bot.loadCommands("./commands") path, which is not needed but for People that don't afford to change all its commands.
//Lets say, you used `bot.loadCommands("./commands")
//but you want to change the path
// to `./myOtherCommands`
// with eval (Example $djsEval)
client.CommandHandler.changeDBDLoadCommandsPath("./myOtherCommands")
Example
//As example if we run the file in `/home/runner/myBotProject`
dbdUtil.resolvePath("./myCommands") // will Return `/home/runner/myBotProject/myCommands`
toObject methodYou can join the dbd.js Support Server or Direct Message me in Discord, ID 502968724207304714.
See MIT License for License
FAQs
A simple Utility that will help dbd.js users develop their bot
The npm package dbd.js-utils receives a total of 4 weekly downloads. As such, dbd.js-utils popularity was classified as not popular.
We found that dbd.js-utils 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.