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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@herb-ert/stringkitjs

v1.1.0

Published

A focused, zero-dependency utility library for common string manipulations in JavaScript. Clean API, no global prototype pollution, and built for real-world use.

Readme

🧩 Stringkit.js

A focused, zero-dependency utility library for common string manipulations in JavaScript. Clean API, no global prototype pollution, and built for real-world use.

NPM version NPM downloads GitHub issues GitHub pull requests GitHub contributors GitHub forks GitHub stars

✨ Features

  • A suite of clean, composable string utilities
  • No global prototype modifications
  • Safe and immutable methods
  • Designed for real-world use cases
  • Fully documented and tested

📦 Installation

npm install @herb-ert/stringkitjs

If you're using ES Modules:

import * as stringkit from '@herb-ert/stringkitjs';

Or with CommonJS:

const stringkit = require('@herb-ert/stringkitjs');

🚀 Usage

import { capitalize, kebabCase } from '@herb-ert/stringkitjs';

console.log(capitalize("hello world")); // "Hello world"
console.log(kebabCase("Hello World"));  // "hello-world"

🧠 API

Functions

| Method | Description | |------------------------|------------------------------------------------------------------------------------------------------------------| | capitalize(string) | Capitalizes the first character of a string. | | title(string, smart) | Converts a string to title case. Optionally applies smart title casing to avoid capitalizing common short words. | | stripTags(string) | Removes all HTML tags from a string. | | slugify(string) | Converts a string into a URL-friendly slug. | | truncate(string, length) | Truncates a string to a specific length, appending "..." if truncated. | | camelCase(string) | Converts a string to camelCase. | | kebabCase(string) | Converts a string to kebab-case. | | snakeCase(string) | Converts a string to snake_case. | | trimLines(string) | Trims whitespace from the start and end of each line in a multi-line string. | | removeExtraSpaces(string) | Removes extra spaces from a string, reducing multiple spaces to a single space. | | isBlank(string) | Checks whether a string is empty or contains only whitespace. | | startsWithIgnoreCase(string, prefix) | Checks if a string starts with a given prefix, ignoring case sensitivity. | | endsWithIgnoreCase(string, suffix) | Checks if a string ends with a given suffix, ignoring case sensitivity.| | includesIgnoreCase(string, substring) | Checks if a string includes a given substring, ignoring case sensitivity.| | escapeRegExp(string) | Escapes special characters in a string for use in a regular expression.| | stripAnsi(string) | Removes ANSI escape codes from a string.| | repeatString(string, times) | Repeats a string a specified number of times.| | commonPrefix(strings) | Finds the longest common prefix among an array of strings.| | center(string, length, char = ' ') | Centers a string by padding it on both sides with a specified character.| | lpad(string, length, char = ' ') | Pads the left side of a string to a specified total length.| | rpad(string, length, char = ' ') | Pads the right side of a string to a specified total length.| | truncateWords(string, wordCount) | Truncates a string to a specific number of words.| | pascalCase(string) | Converts a string to PascalCase.| | reverse(string) | Reverses the characters in a string.| | assertString(value, name) | Asserts that the given value is a string. |

📦 More Examples

import {
  snakeCase,
  stripTags,
  title,
  startsWithIgnoreCase
} from '@herb-ert/stringkitjs';

console.log(snakeCase("Hello World"));                    // "hello_world"
console.log(stripTags("<p>Hello</p>"));                   // "Hello"
console.log(title("the big brown fox"));                  // "The Big Brown Fox"
console.log(startsWithIgnoreCase("JavaScript", "java"));  // true

🧪 Validation

All functions are pure and expect valid strings. Invalid types will throw helpful errors.

capitalize(42); // ❌ TypeError: Expected "string" to be a string, but got number

🔧 License

MIT © herb-ert