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

@shotlingo/character-counter

v0.1.0

Published

Count text the way App Store Connect and Google Play Console count it (UTF-16 code units), plus human-perceived grapheme count and UTF-8 byte length. Zero dependencies, no network calls.

Readme

@shotlingo/character-counter

Count text the way App Store Connect and Google Play Console count it (UTF-16 code units), plus the count a human would actually perceive (grapheme clusters) and UTF-8 byte length. Zero dependencies, no network calls.

Field limits to check against: @shotlingo/character-limits Full interactive reference: shotlingo.com/tools/app-store-character-limits

Why this matters

App Store Connect and Play Console both count length in UTF-16 code units, the same value as JavaScript's string.length. A single flag emoji or an accented character built from a surrogate pair can silently eat 2 or more of your 30-character subtitle. Array.from(text).length does not fix this either: it counts Unicode codepoints, not the code units the stores actually enforce, and it still splits multi-codepoint grapheme clusters like flags and family emoji into more than one unit.

This package gives you all three counts so you can check the one that matches the field you are filling in.

Install

npm install @shotlingo/character-counter

Usage

import { countCharacters, countGraphemes, byteLength, countAll, checkAgainstLimit } from '@shotlingo/character-counter';

countCharacters('🇹🇷');
// => 4 (what App Store Connect / Play Console count)

countGraphemes('🇹🇷');
// => 1 (what a person sees)

byteLength('İstanbul');
// => 9 (UTF-8 bytes; countCharacters would say 8)

countAll('🇹🇷');
// => { characters: 4, graphemes: 1, bytes: 8 }

checkAgainstLimit('My Great App', 30);
// => { count: 12, limit: 30, unit: 'characters', fits: true, remaining: 18 }

API

  • countCharacters(text: string): number — UTF-16 code unit count. Matches string.length and store character counters.
  • countGraphemes(text: string): number — user-perceived character count via Intl.Segmenter.
  • byteLength(text: string): number — UTF-8 byte length.
  • countAll(text: string): CountResult{ characters, graphemes, bytes }.
  • checkAgainstLimit(text: string, limit: number, unit?: 'characters' | 'bytes'): LimitCheck{ count, limit, unit, fits, remaining }. Defaults to 'characters', matching how stores enforce their limits.

License

MIT