Skip to main content
Home

Built and signed on GitHub Actions

A collection of utility functions

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
88%
Published
a year ago (0.2.2)
namespace string

Functions

f
string.camelCase

This function returns the string in camelCase.

f
string.capitalize

This function returns the string with the first character capitalized.

f
string.constantCase

This function returns the string in CONSTANT_CASE.

f
string.format

This function returns a formatted string.

f
string.formatNamed

This function returns a formatted string.

f
string.htmlSafe

This function returns a html safe string.

f
string.isAlpha

This function returns a boolean indicating if str is alphabetic.

f
string.isAlphaNumeric

This function returns a boolean indicating if str is alphanumeric.

f
string.isAnagram

This function returns a boolean indicating if str1 and str2 are anagrams.

f
string.isCamelCase

This function returns a boolean indicating if str is camel case.

f
string.isConstantCase

This function returns a boolean indicating if str is constant case.

f
string.isKebabCase

This function returns a boolean indicating if str is kebab case.

f
string.isLowerCase

This function returns a boolean indicating if str is lowercase.

f
string.isNumeric

This function returns a boolean indicating if str is numeric.

f
string.isPalindrome

This function returns a boolean indicating if str is a palindrome.

f
string.isPascalCase

This function returns a boolean indicating if str is pascal case.

f
string.isSnakeCase

This function returns a boolean indicating if str is snake case.

f
string.isTitleCase

This function returns a boolean indicating if str is title case.

f
string.isUpperCase

This function returns a boolean indicating if str is uppercase.

f
string.kebabCase

This function returns the string in kebab-case.

f
string.mask

This function returns the string with all characters replaced with maskChar.

f
string.normalizeWhitespace

This function returns the string with extra whitespace removed.

f
string.pascalCase

This function returns the string in PascalCase.

f
string.removeExtraWhitespace

This function returns the string with extra whitespace removed.

f
string.removeHtmlTags

This function returns a string with html tags removed.

f
string.removeNonAlpha

This function returns the string with non-alpha characters removed.

f
string.removeNonAlphaNumeric

This function returns the string with non-alphanumeric characters removed.

f
string.removeNonNumeric

This function returns the string with non-numeric characters removed.

f
string.removePrefix

This function returns the string without the prefix.

f
string.removeSuffix

This function returns the string without the suffix.

f
string.removeWhitespace

This function returns the string with whitespace removed.

f
string.reverse

This function returns the string in reverse.

f
string.snakeCase

This function returns the string in snake_case.

f
string.titleCase

This function returns the string in Title Case.

f
string.totalOccurrences

This function returns the total occurrences of subStr in str.

f
string.truncate

This function returns the string truncated to maxLength with suffix appended.

f
string.xssSafe

This function returns a xss safe string.

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:@modules/utils

Import symbol

import { string } from "@modules/utils";
or

Import directly with a jsr specifier

import { string } from "jsr:@modules/utils";

Add Package

pnpm i jsr:@modules/utils
or (using pnpm 10.8 or older)
pnpm dlx jsr add @modules/utils

Import symbol

import { string } from "@modules/utils";

Add Package

yarn add jsr:@modules/utils
or (using Yarn 4.8 or older)
yarn dlx jsr add @modules/utils

Import symbol

import { string } from "@modules/utils";

Add Package

vlt install jsr:@modules/utils

Import symbol

import { string } from "@modules/utils";

Add Package

npx jsr add @modules/utils

Import symbol

import { string } from "@modules/utils";

Add Package

bunx jsr add @modules/utils

Import symbol

import { string } from "@modules/utils";