@annieverse/annieverseutil
v1.0.6
Published
A repo designed to house all util functionality for discord bot Annie
Readme
website
Main Discord bot Annie's dashboard
annieverseUtil
A repo designed to house all util functionality for Discord bot Annie.
Features
- General utilities (array chunking, number formatting, etc.)
- Pixiv image downloading
- String similarity matching
Installation
npm install @annieverse/annieverseutilUsage
// CommonJS
const { chunkOptions, downloadPixivImage } = require('@annieverse/annieverseutil');
// ES Module
import { chunkOptions, downloadPixivImage} from '@annieverse/annieverseutil';Modules
utils
chunkOptions– Chunk an array into groups.random– Get a random element from an arrayclosetBelow- Get the closest value in an array that is below a specified valuecommanifier- Format a number with commas as thousands separatorsformatK- Format a number into a more readable stringgetNumberInRange- Get a random integer within a specified rangetrueInt- Get a true integer value from a string
pixiv
downloadPixivImage– Download an image from Pixiv.
string-similarity
findBestMatch– Finds the best match for a given string within an array of target strings.compareTwoStrings– Compares two strings and returns a similarity score between 0 and 1.
Contributors
- Naph (klerikdust)
- Pan (Moore2021)
License
MIT
