New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dbd-tools

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbd-tools

A package that contains an collection of useful tools.

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
12
1100%
Maintainers
2
Weekly downloads
 
Created
Source

DBD Tools

This is a collection of tools for javascript.

Installation

npm install dbd-tools

Tools

const dbdTools = require('dbd-tools');

// Utils
dbdTools.Utils.sleep(ms); // Sleeps for a specific amount of time.

// String tools
dbdTools.StringUtils.formatText(text, type); // Formats text to a specific case.
dbdTools.StringUtils.generateId(size); // Generates a random string of a specific size.
dbdTools.StringUtils.generateUuid(); // Generates a random Unique User ID.
dbdTools.StringUtils.replacer(string, options); // Replaces a string with matching values.

// Number tools
dbdTools.NumberUtils.getRandom(min, max); // Generates a random number between a min and max value.

// Array tools
dbdTools.ArrayUtils.chunk(array, size); // Splits an array into chunks of a specific size.
dbdTools.ArrayUtils.hasMatches(array1, array2); // Checks if two arrays have any matching values.
dbdTools.ArrayUtils.clearDuplicates(array); // Gets all duplicate values in an array.
dbdTools.ArrayUtils.getMatches(array1, array2); // Gets all values that are in both arrays.
dbdTools.ArrayUtils.shuffle(array); // Shuffles an array.

// Object tools
dbdTools.ObjectUtils.hasKey(object, key); // Checks if an object has a specific key.
dbdTools.ObjectUtils.hasValue(object, value); // Checks if an object has a specific value.
dbdTools.ObjectUtils.getKeys(object); // Gets all keys in an object.
dbdTools.ObjectUtils.getValue(object, path); // Gets a value from an object using a path.
dbdTools.ObjectUtils.setValue(object, path, value); // Sets a value in an object using a path.
dbdTools.ObjectUtils.getValues(object); // Gets all values in an object.
dbdTools.ObjectUtils.getEntries(object); // Gets all entries in an object.
dbdTools.ObjectUtils.flatten(object); // Flattens an object.

// Cache tools
dbdTools.CacheUtils.getCache(path); // Gets a cache file.
dbdTools.CacheUtils.updateCache(cache); // Updates a cache file.

// Discord tools
dbdTools.DiscordUtils.formatButtons(buttons); // Formats buttons for discord.js.
dbdTools.DiscordUtils.formatSelects(options); // Formats selects for discord.js.
dbdTools.DiscordUtils.getMentions(text, type); // Gets all mentions from a string.

// Parse tools
dbdTools.ParseUtils.parseEmojis(text); // Parses emojis from a string.
dbdTools.ParseUtils.parseHexColors(text); // Parses hex colors from a string.
dbdTools.ParseUtils.parseRgbColors(text); // Parses rgb colors from a string.
dbdTools.ParseUtils.parseHslColors(text); // Parses hsl colors from a string.
dbdTools.ParseUtils.parseDecimalColors(text); // Parses decimal colors from a string.
dbdTools.ParseUtils.parseMilliseconds(ms, { seconds: true, minutes: true }); // Parses milliseconds into a readable time.

// Convert tools
dbdTools.ConvertUtils.hexToDecimal(hex); // Converts a hex color to a decimal color.

Usage

const dbdTools = require('dbd-tools');

Support

If you have any questions, please make an issue on the GitHub repository.

FAQs

Package last updated on 06 Sep 2023

Did you know?

Socket

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.

Install

Related posts