A collection of helper functions. String manipulation, array operations and others to simplify development and improve efficiency.
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers




JSR Score
100%
Published
a year ago (0.0.6)
MAM Helpers
WIP
Levenshtein Distance
getEditDistance("Koala", "Koala"); // >> 0 getEditDistance("Koala", "Koalin"); // >> 2
Random Number (Both included)
getRandomNumber(10, 20); // >> 15 getRandomNumber(10, 20); // >> 10 getRandomNumber(10, 20); // >> 20
Get Random Boolean
getRandomBoolean(); // true getRandomBoolean(); // false
Get Random Element from Array
getRandomElement([1, 2, 3, 4, 5]); // 3 getRandomElement([1, 2, 3, 4, 5]); // 1
Shuffle Array (Returns a Copy not affecting the passed array)
shuffleArray([1, 2, 3, 4, 5]); // [3, 2, 5, 4, 1]
Capitalize first letter
capitalizeFirstLetter("clear sky"); // Clear sky
Capitalize first letter of each word
capitalizeEachWord("clear sky"); // Clear Sky
Add Package
deno add jsr:@mam/helpers
Import symbol
import * as helpers from "@mam/helpers";
Import directly with a jsr specifier
import * as helpers from "jsr:@mam/helpers";
Add Package
pnpm i jsr:@mam/helpers
pnpm dlx jsr add @mam/helpers
Import symbol
import * as helpers from "@mam/helpers";
Add Package
yarn add jsr:@mam/helpers
yarn dlx jsr add @mam/helpers
Import symbol
import * as helpers from "@mam/helpers";
Add Package
vlt install jsr:@mam/helpers
Import symbol
import * as helpers from "@mam/helpers";
Add Package
npx jsr add @mam/helpers
Import symbol
import * as helpers from "@mam/helpers";
Add Package
bunx jsr add @mam/helpers
Import symbol
import * as helpers from "@mam/helpers";