Skip to main content
Home

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
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
It is unknown whether this package works with 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

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mam/helpers

Import symbol

import * as helpers from "@mam/helpers";
or

Import directly with a jsr specifier

import * as helpers from "jsr:@mam/helpers";

Add Package

pnpm i jsr:@mam/helpers
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mam/helpers

Import symbol

import * as helpers from "@mam/helpers";

Add Package

yarn add jsr:@mam/helpers
or (using Yarn 4.8 or older)
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";