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

isotropic-character-fold

v0.8.1

Published

A utility to replace special characters in a string

Readme

isotropic-character-fold

npm version License

A lightweight utility to normalize strings by replacing special characters with their basic ASCII equivalents.

Why Use This?

  • Improved Search Functionality: Users often search without special characters, diacritics, or accents
  • Simplified String Comparison: Makes it easier to compare strings regardless of special characters
  • Normalized Sorting: Ensures consistent alphabetical sorting by treating similar characters the same

Installation

npm install isotropic-character-fold

Usage

import _characterFold from 'isotropic-character-fold';

// Replace accented characters
_characterFold('résumé'); // returns "resume"

// Replace special character variants
_characterFold('ŧęṧᵵṨⓣȑïȵɠ'); // returns "testString"

// Handle combining characters
_characterFold('n̂őŕm̃àłȋẑĕ'); // returns "normalize"

How It Works

isotropic-character-fold uses JavaScript's native String.normalize('NFKC') method combined with the diacritics-map package to:

  1. Normalize Unicode characters to their canonical form
  2. Replace diacritics and special characters with basic ASCII equivalents
  3. Remove remaining non-spacing marks

The module handles a wide range of special characters including:

  • Accented characters (é, ü, ñ, etc.)
  • Special character variants (ⓣ, ṧ, etc.)
  • Combining characters (characters with multiple diacritical marks)

API

characterFold(string)

Returns a normalized version of the input string with special characters replaced by their basic ASCII equivalents.

Parameters

  • string (String): The string to normalize

Returns

  • (String): The normalized string

Examples

Basic Character Replacement

import _characterFold from 'isotropic-character-fold';

// Accented characters
_characterFold('café'); // returns "cafe"
_characterFold('naïve'); // returns "naive"

// Special letter variants
_characterFold('ⓈⓊⓃⓈⓗⒾⓃⒺ'); // returns "SUNSHINE"

Use in Search Implementation

import _characterFold from 'isotropic-character-fold';

const _searchItems({
    items,
    query
}) => {
    const normalizedQuery = _characterFold(query).toLowerCase();

    return items.filter(item => {
        const normalizedItem = _characterFold(item).toLowerCase();

        return normalizedItem.includes(normalizedQuery);
    });
}

// Example usage
_searchItems({
    items: [
        'Café Americano',
        'Cafè Latte',
        'Café Mocha'
    ],
    query: 'cafe'
}); // Returns all items

_searchItems({
    items: [
        'résumé',
        'Resume',
        'RÉSUMÉ'
    ],
    query: 'resume'
}); // Returns all items

Use in Sorting

import _characterFold from 'isotropic-character-fold';

const _names = [
        'Zoë',
        'Ángel',
        'Adrian',
        'Bob'
    ],
    // Sort with character folding
    _sortedNames = _names.toSorted((a, b) => _characterFold(a).localeCompare(_characterFold(b)));

// _sortedNames: ['Adrian', 'Ángel', 'Bob', 'Zoë']

Contributing

Please refer to CONTRIBUTING.md for contribution guidelines.

Issues

If you encounter any issues, please file them at https://github.com/ibi-group/isotropic-character-fold/issues