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

tiny-text-transform

v1.0.6

Published

A simple plugin to transform the text.

Readme

Tiny Text Transform (tiny-text-transform)

A tiny, zero-dependency TypeScript/JavaScript library for common text transformations.

Features

  • 🚀 Lightweight and dependency-free.
  • 📦 Fully typed with TypeScript.
  • 🔒 Pure functions with no side effects.
  • ✨ Simple and predictable API.
  • 🔤 Supports common text transformations including:
    • Title Case
    • Sentence Case
    • UPPERCASE
    • lowercase
    • kebab-case
    • PascalCase
    • snake_case
    • Alphanumeric filtering
    • Text reversal
    • Single Spaced Sentences
    • Remove Emoji ✅
    • Detect Emoji ✅

Installation

Using npm:

npm install tiny-text-transform

Using Yarn:

yarn add tiny-text-transform

Usage

Import only the functions you need.

import {
  makeFirstLetterUpper,
  makeTitleCase,
  makeSentenceCase,
  makeAllUpperCase,
  makeAllLowerCase,
  makeKebabCase,
  makeKebabLowerCase,
  makePascalCase,
  makeSnakeCase,
  makeTextEmojiFree,
  checkEmoji
} from 'tiny-text-transform';

const text = 'hello world. this is a test.';
const mixedText = 'Hello World. this is a TEST.';
const textWithEmoji = "Hi there, ✅ (This is a text with a lot of Emojis ✅ to demo ✅)";

console.log(makeTitleCase(text));
// => "Hello World. This Is A Test."

console.log(makeFirstLetterUpper(text));
// => "Hello world. this is a test."

console.log(makeSentenceCase(text));
// => "Hello world. This is a test."

console.log(makeAllUpperCase(text));
// => "HELLO WORLD. THIS IS A TEST."

console.log(makeAllLowerCase(mixedText));
// => "hello world. this is a test."

console.log(makeKebabCase(text));
// => "hello-world-this-is-a-test"

console.log(makeKebabLowerCase(mixedText));
// => "hello-world-this-is-a-test"

console.log(makePascalCase(text));
// => "HelloWorldThisIsATest"

console.log(makeSnakeCase(text));
// => "hello_world_this_is_a_test"

console.log(makeTextEmojiFree(textWithEmoji));
// => "Hi there, (This is a text with a lot of Emojis to demo)"

// ------------ Validation Methods ----------------

console.log(checkEmoji(textWithEmoji));
// => true

API Reference

All functions are pure and return a new string for valid string inputs.

If the input is null, undefined, or an empty string, the original value is returned unchanged.


makeFirstLetterUpper(text: string): string

Capitalizes only the first letter of a string.

makeFirstLetterUpper('hello world');
// => "Hello world"

makeTitleCase(text: string): string

Capitalizes the first letter of every word.

makeTitleCase('my awesome library');
// => "My Awesome Library"

makeSentenceCase(text: string): string

Capitalizes the first letter of each sentence separated by . .

makeSentenceCase('hello world. this is a test.');
// => "Hello world. This is a test."

makeAllUpperCase(text: string): string

Converts every character to uppercase.

makeAllUpperCase('hello world');
// => "HELLO WORLD"

makeAllLowerCase(text: string): string

Converts every character to lowercase.

makeAllLowerCase('HELLO WORLD');
// => "hello world"

makeSingleSpaced(text: string): string

Removes leading and trailing whitespace and replaces multiple consecutive whitespace characters with a single space.

makeSingleSpaced('  hello     world   ');
// => "hello world"

makeKebabCase(text: string): string

Removes special characters, replaces spaces with hyphens (-), and preserves the original letter casing.

makeKebabCase('Hello World! Welcome.');
// => "Hello-World-Welcome"

makeKebabLowerCase(text: string): string

Removes special characters, converts all letters to lowercase, and replaces spaces with hyphens (-).

makeKebabLowerCase('Hello World! Welcome.');
// => "hello-world-welcome"

makePascalCase(text: string): string

Removes special characters and converts the text to PascalCase.

makePascalCase('my awesome library');
// => "MyAwesomeLibrary"

makeSnakeCase(text: string): string

Removes special characters, replaces spaces with underscores (_), and preserves the original letter casing.

makeSnakeCase('My Variable Name');
// => "My_Variable_Name"

makeAlphanumeric(text: string): string

Removes all non-alphanumeric characters while preserving spaces.

makeAlphanumeric('hello!@#$ world 123');
// => "hello world 123"

makeTextReversed(text: string): string

Reverses the characters in the string.

makeTextReversed('hello world');
// => "dlrow olleh"

makeTextEmojiFree(text: string): string

Removes all emojis and returns a clean string.

makeTextEmojiFree('Hi there, ✅ (This is a text with a lot of Emojis ✅ to demo✅)');
// => "Hi there, (This is a text with a lot of Emojis to demo)"

Validation Functions

checkEmoji(text: string): boolean

Detects if the string has an emoji and returns a boolean value.

checkEmoji('Hi there, ✅ (This is a text with a lot of Emojis ✅ to demo✅)');
// => true

Examples

| Input | Function | Output | |--------|----------|--------| | hello world | makeFirstLetterUpper | Hello world | | hello world | makeTitleCase | Hello World | | hello world. this is a test. | makeSentenceCase | Hello world. This is a test. | | hello world | makeAllUpperCase | HELLO WORLD | | HELLO WORLD | makeAllLowerCase | hello world | | hello world | makeSingleSpaced | hello world | | Hello World! | makeKebabCase | Hello-World | | Hello World! | makeKebabLowerCase | hello-world | | my awesome library | makePascalCase | MyAwesomeLibrary | | My Variable Name | makeSnakeCase | My_Variable_Name | | hello!@#$ world 123 | makeAlphanumeric | hello world 123 | | hello world | makeTextReversed | dlrow olleh | | Hi there, ✅ (This is a text with a lot of Emojis ✅ to demo✅) | makeTextEmojiFree | Hi there, (This is a text with a lot of Emojis to demo) | | Hi there, ✅ (This is a text with a lot of Emojis ✅ to demo✅) | checkEmoji | true |


Contributing

Issues and pull requests are welcome!

If you find a bug or have an idea for a new text transformation, feel free to open an issue or submit a pull request.


License

MIT License

Copyright (c) 2026 Shrujan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.