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-trans

v1.0.5

Published

A simple string utilities library

Readme

String Utilities Library

A comprehensive library for performing various string manipulations. This library provides utility functions that simplify and enhance string operations for JavaScript projects.

Installation

To use this library, first install it:

npm install 'text-trans';

Add the file containing the exported functions to your project and import the desired utilities.

import { capitalize, reverse, truncate, ... } from 'text-trans';

Functions Overview

1. capitalize

  • Description: Capitalizes the first letter of a string.
  • Arguments:
    • str (string): The input string.
  • Returns: A new string with the first letter capitalized.
  • Example:
    capitalize("hello world"); // Output: "Hello world"

2. reverse

  • Description: Reverses the given string.
  • Arguments:
    • str (string): The input string.
  • Returns: The reversed string.
  • Example:
    reverse("hello"); // Output: "olleh"

3. truncate

  • Description: Truncates a string to the specified length and appends an ellipsis (...) if necessary.
  • Arguments:
    • str (string): The input string.
    • length (number): The maximum length of the string.
  • Returns: The truncated string with an ellipsis if it exceeds the length.
  • Example:
    truncate("This is a long string", 10); // Output: "This is a..."

4. toCamelCase

  • Description: Converts a string to camelCase.
  • Arguments:
    • str (string): The input string.
  • Returns: The camelCase formatted string.
  • Example:
    toCamelCase("hello world example"); // Output: "helloWorldExample"

5. toPascalCase

  • Description: Converts a string to PascalCase.
  • Arguments:
    • str (string): The input string.
  • Returns: The PascalCase formatted string.
  • Example:
    toPascalCase("hello world example"); // Output: "HelloWorldExample"

6. toKebabCase

  • Description: Converts a string to kebab-case.
  • Arguments:
    • str (string): The input string.
  • Returns: The kebab-case formatted string.
  • Example:
    toKebabCase("Hello World Example"); // Output: "hello-world-example"

7. toSnakeCase

  • Description: Converts a string to snake_case.
  • Arguments:
    • str (string): The input string.
  • Returns: The snake_case formatted string.
  • Example:
    toSnakeCase("Hello World Example"); // Output: "hello_world_example"

8. toTitleCase

  • Description: Converts a string to Title Case.
  • Arguments:
    • str (string): The input string.
  • Returns: The Title Case formatted string.
  • Example:
    toTitleCase("hello world example"); // Output: "Hello World Example"

9. wordCount

  • Description: Counts the number of words in a string.
  • Arguments:
    • str (string): The input string.
  • Returns: The word count as a number.
  • Example:
    wordCount("This is a sample sentence."); // Output: 5

10. isPalindrome

  • Description: Checks if a string is a palindrome.
  • Arguments:
    • str (string): The input string.
  • Returns: A boolean value indicating whether the string is a palindrome.
  • Example:
    isPalindrome("A man, a plan, a canal: Panama"); // Output: true
    isPalindrome("hello"); // Output: false

📜 License

This library is open-source and can be used freely in personal and commercial projects.

📧 Contact

For any inquiries, feedback, or support:


Inspired by NPM && Created with 💝 by Piyush