npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

text-beautifier

v1.0.1

Published

A simple utility for text formatting and beautification

Readme

🎨 Text Beautifier

Text Beautifier Logo

NPM version NPM downloads License TypeScript Tests


🚀 Мощная утилита для форматирования и обработки текста с поддержкой TypeScript
✨ Более 20 полезных функций для манипуляции текстом
📦 Нулевые зависимости
💡 Полная типизация
⚡ Высокая производительность

📥 Установка

npm install text-beautifier
# или
yarn add text-beautifier
# или
pnpm add text-beautifier

🚀 Использование

import { TextBeautifier } from 'text-beautifier';

// ✨ Форматирование регистра
TextBeautifier.capitalize('hello world');          // 'Hello World'
TextBeautifier.toAlternatingCase('hello');        // 'HeLlO'
TextBeautifier.ucfirst('hello');                  // 'Hello'
TextBeautifier.lcfirst('Hello');                  // 'hello'

// 🎯 Преобразование стилей именования
TextBeautifier.toCamelCase('hello-world');        // 'helloWorld'
TextBeautifier.toPascalCase('hello-world');       // 'HelloWorld'
TextBeautifier.toSnakeCase('helloWorld');         // 'hello_world'
TextBeautifier.toKebabCase('helloWorld');         // 'hello-world'
TextBeautifier.toTitleCase('hello world');        // 'Hello World'
TextBeautifier.slugify('Hello World!');           // 'hello-world'

// 📝 Работа с пробелами и переносами
TextBeautifier.removeExtraSpaces('hello   world'); // 'hello world'
TextBeautifier.wrap('hello world', 5);            // 'hello\nworld'
TextBeautifier.center('hello', 9);                // '  hello  '

// 🔄 Манипуляции с текстом
TextBeautifier.truncate('hello world', 8);        // 'hello...'
TextBeautifier.reverse('hello');                  // 'olleh'
TextBeautifier.repeat('ha', 3);                   // 'hahaha'
TextBeautifier.shuffle('hello');                  // случайная перестановка букв

// 📊 Анализ текста
TextBeautifier.wordCount('hello world');          // 2
TextBeautifier.charCount('hello world');          // 10
TextBeautifier.charCount('hello world', true);    // 11 (с пробелами)
TextBeautifier.isPalindrome('radar');             // true

// 🔍 Извлечение данных
TextBeautifier.extractUrls('Visit https://example.com');    // ['https://example.com']
TextBeautifier.extractEmails('Contact [email protected]');   // ['[email protected]']
TextBeautifier.extractNumbers('hello123world456');         // [123, 456]

// 🗑️ Удаление символов
TextBeautifier.removeNumbers('hello123');         // 'hello'
TextBeautifier.removeSpecialChars('hello@world!'); // 'hello world'

📚 API

✨ Форматирование регистра

| Метод | Описание | |-------|----------| | capitalize(text: string): string | Делает первую букву каждого слова заглавной | | toAlternatingCase(text: string): string | Преобразует текст в чередующийся регистр | | ucfirst(text: string): string | Делает первую букву текста заглавной | | lcfirst(text: string): string | Делает первую букву текста строчной |

🎯 Преобразование стилей именования

| Метод | Описание | |-------|----------| | toCamelCase(text: string): string | Преобразует текст в camelCase | | toPascalCase(text: string): string | Преобразует текст в PascalCase | | toSnakeCase(text: string): string | Преобразует текст в snake_case | | toKebabCase(text: string): string | Преобразует текст в kebab-case | | toTitleCase(text: string): string | Преобразует текст в Title Case | | slugify(text: string): string | Преобразует текст в URL-совместимый формат |

📝 Работа с пробелами и переносами

| Метод | Описание | |-------|----------| | removeExtraSpaces(text: string): string | Удаляет лишние пробелы | | wrap(text: string, width: number): string | Переносит текст по заданной ширине | | center(text: string, width: number, padChar?: string): string | Центрирует текст |

🔄 Манипуляции с текстом

| Метод | Описание | |-------|----------| | truncate(text: string, maxLength: number): string | Обрезает текст с добавлением многоточия | | reverse(text: string): string | Переворачивает текст | | repeat(text: string, times: number): string | Повторяет текст указанное количество раз | | shuffle(text: string): string | Перемешивает символы в тексте |

📊 Анализ текста

| Метод | Описание | |-------|----------| | wordCount(text: string): number | Подсчитывает количество слов | | charCount(text: string, includeSpaces?: boolean): number | Подсчитывает количество символов | | isPalindrome(text: string): boolean | Проверяет, является ли текст палиндромом |

🔍 Извлечение данных

| Метод | Описание | |-------|----------| | extractUrls(text: string): string[] | Извлекает все URL из текста | | extractEmails(text: string): string[] | Извлекает все email-адреса из текста | | extractNumbers(text: string): number[] | Извлекает все числа из текста |

🗑️ Удаление символов

| Метод | Описание | |-------|----------| | removeNumbers(text: string): string | Удаляет все цифры из текста | | removeSpecialChars(text: string): string | Удаляет все специальные символы |

📄 Лицензия

MIT © 2024