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

ukr-string-processor

v1.0.7

Published

Set of tools to process strings in Ukrainian

Readme

Text Utilities for Ukrainian & Multilingual Processing

A comprehensive collection of text processing utilities focused on Ukrainian language specifics, typographical normalization, transliteration, and general string cleanup.


Installation

npm install ukr-string-processor

Overview

This package provides a set of utilities to:

  • Normalize typography (spaces, hyphens, quotes, apostrophes, ellipses, and punctuation)
  • Fix and unify common text input issues (keyboard layouts, false apostrophes, false quotes)
  • Convert between Cyrillic and Latin alphabets, including smart transliteration tailored for Ukrainian
  • Capitalize and format strings with language-specific rules
  • Replace numbers with their letter equivalents
  • Trim and clean text with strict rules for whitespace

Our team used these scripts to clean up the files converted into markdown.

| Function | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------- | | capitalize | Capitalizes the first letter of a string, respecting language-specific rules. | | changeKeyboardLayoutEnToUk | Converts English keyboard layout typed text to Ukrainian layout (e.g., "ghbdsn" → "привіт"). | | fixRomeNumbers | Replaces Ukrainian characters in Roman numerals in text. | | fixSpacesNearPunctuations | Corrects spaces around punctuation marks for proper typography. | | fixSpacesNearQuotes | Corrects spacing issues around quotation marks. | | regexLatinToCyryllic | Provides a regex for matching Cyryllic words by a word transliterated into Latin. | | removeDoublePunctuations | Removes duplicated punctuation marks in the text. | | removeSpacesNearApostrophes | Removes unnecessary spaces around apostrophes if any. | | replaceCyryllicWithLatin | Replaces all Cyrillic characters with visually similar Latin characters. | | replaceEllipsis | Replaces sequences of dots with a proper ellipsis character. | | replaceFalseApostrophes | Fixes apostrophes that are visually similar but incorrect for Ukrainian text. | | replaceFalseQuotes | Fixes misuse of quote characters, replacing them with typographically correct ones. | | replaceLatinInCyryllic | Replaces Latin letters that appear inside Cyrillic text with proper Cyrillic letters. | | replaceLatinSmart | Smart replacement of Latin characters within Cyrillic text, preventing false replacements. | | replaceLatinWithCyryllic | Replaces all Latin letters that look like Cyrillic with their Cyrillic counterparts. | | replaceNumbersWithLetters | Converts digits into their spelled-out letter equivalents (e.g. "3оя" → "Зоя"). | | replaceRuWithUk | Replaces Russian letters mistakenly typed with the wrong keyboard layout. | | replaceUnnecessarySpaces | Removes extra spaces where not needed, especially near punctuation. | | strictTrim | Trims strings strictly, removing various Unicode space characters and collapsing multiple spaces. | | toTitleCase | Converts string to title case respecting Ukrainian letters and apostrophes. | | transliterate | Converts Ukrainian Cyrillic text into Latin script using official transliteration rules. | | unifyApostrophes | Replaces multiple apostrophe-like characters with a single standard apostrophe '. | | unifyHyphens | Replaces different hyphen and dash characters with a standard ASCII hyphen -. | | unifyQuotes | Replaces different quote characters with a single standard quote ". | | unifySpaces | Normalizes various Unicode space characters to a regular space and collapses multiples. |


Usage

import { unifySpaces, transliterate, toTitleCase } from 'ukr-string-processor'

const rawText = "Привіт– світе…  Це   тест"

const cleanedText = unifySpaces(rawText)  
// "Привіт- світе… Це тест"

const translit = transliterate(cleanedText)
// "Pryvit- svite… Tse test"

const title = toTitleCase(translit)
// "Pryvit- Svite… Tse Test"

console.log(title)

Contributing

Contributions and suggestions are welcome! Please open issues or pull requests on the GitHub repository.