
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@utilify/string
Advanced tools
The string utility functions provide a variety of methods for text manipulation, such as transforming, counting words, sanitizing, and formatting strings.
The string utility functions provide a variety of methods for text manipulation, such as transforming, counting words, sanitizing, and formatting strings.
To install the string utilities package, use one of the following commands, depending on your package manager:
npm install @utilify/string
yarn add @utilify/string
pnpm add @utilify/string
Once installed, you can import the functions into your project, using ESM or CJS.
import { capitalize, invertCase, maskString, isUpperCase, isLowerCase } from '@utilify/string';
const { capitalize, invertCase, maskString, isUpperCase, isLowerCase } = require('@utilify/string');
Here is an overview of the available functions in the string utilities package:
function capitalize(str: string): string
Capitalizes the first letter of a string.
function invertCase(str: string): string
Inverts the case of each character in a string.
function isLowerCase(str: string): boolean
Checks if the string is in lowercase.
function isUpperCase(str: string): boolean
Checks if the string is in uppercase.
function maskString(str: string, maskStart: number, maskEnd: number, mask: string = '*'): string
Replaces a portion of the string with a mask character.
function removeAccents(str: string): string
Removes accents from a string.
function slugify(str: string): string
Transforms a string into a URL-friendly format (slug).
function toCamelCase(str: string): string
Transforms a string into camelCase format.
function toKebabCase(str: string): string
Transforms a string into kebab-case format.
function toPascalCase(str: string): string
Transforms a string into PascalCase format.
function toSnakeCase(str: string): string
Transforms a string into snake_case format.
function truncate(text: string, size: number): string
Truncates a string to a specific size and adds "..." at the end.
function wordCount(str: string): number
Counts the number of words in a string.
FAQs
The string utility functions provide a variety of methods for text manipulation, such as transforming, counting words, sanitizing, and formatting strings.
We found that @utilify/string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.