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

string-filters

v0.3.3

Published

Fast native javascript string filters library.

Readme

Javascript String Filters

Fast native javascript string filters library.

Contents

  1. Compatibility
  2. Installation
    1. NPM
    2. Manually
  3. Usage
    1. Camel case
    2. Capitalize
    3. Flat case
    4. Kebab case
    5. Pad
    6. Pascal case
    7. Snake case
    8. Title case
    9. Train case
    10. Truncate
  4. Author
  5. License

Compatibility

Browser | Version ------- | ------- Chrome | >= 107 Edge | >= 107 Firefox | >= 104 Safari | >= 16

Installation

NPM

npm install string-filters

Manually

Download package and unpack it or use following commands:

wget https://github.com/tarkhov/js-string-filters/releases/download/v0.1.0/js-string-filters.zip
unzip js-string-filters.zip

Usage

Camel case

import { camelCase } from 'string-filters'

let result = ''
result = camelCase('camel 123 case')
// Output: camelCase
console.log(result)

result = camelCase('camel 123 case', { numbers: true })
// Output: camel123Case
console.log(result)

result = camelCase('cameL 123 casE', { lower: true })
// Output: camelCase
console.log(result)

result = camelCase('cameL 123 casE', { numbers: true, lower: true })
// Output: camel123Case
console.log(result)

Capitalize

import { capitalize } from 'string-filters'

let result = ''
result = capitalize('capitalize')
// Output: Capitalize
console.log(result)

result = capitalize('cApitalizE', true)
// Output: Capitalize
console.log(result)

Flat case

import { flatCase } from 'string-filters'

let result = ''
result = flatCase('Flat 123 Case')
// Output: flatcase
console.log(result)

result = flatCase('Flat 123 Case', true)
// Output: flat123case
console.log(result)

Kebab case

import { kebabCase } from 'string-filters'

let result = ''
result = kebabCase('Kebab 123 Case')
// Output: kebab-case
console.log(result)

result = kebabCase('Kebab 123 Case', true)
// Output: kebab-123-case
console.log(result)

Pad

import { pad } from 'string-filters'

let result = ''
result = pad('pad', 10, '_')
// Output: ___pad____
console.log(result)

Pascal case

import { pascalCase } from 'string-filters'

let result = ''
result = pascalCase('pascal 123 case')
// Output: PascalCase
console.log(result)

result = pascalCase('pascal 123 case', { numbers: true })
// Output: Pascal123Case
console.log(result)

result = pascalCase('pascaL 123 casE', { lower: true })
// Output: PascalCase
console.log(result)

result = pascalCase('pascaL 123 casE', { numbers: true, lower: true })
// Output: Pascal123Case
console.log(result)

Snake case

import { snakeCase } from 'string-filters'

let result = ''
result = snakeCase('Snake 123 Case')
// Output: snake_case
console.log(result)

result = snakeCase('Snake 123 Case', true)
// Output: snake_123_case
console.log(result)

Title case

import { titleCase } from 'string-filters'

let result = ''
result = titleCase('title 123 case')
// Output: Title Case
console.log(result)

result = titleCase('title 123 case', { numbers: true })
// Output: Title 123 Case
console.log(result)

result = titleCase('titlE 123 casE', { lower: true })
// Output: Title Case
console.log(result)

result = titleCase('titlE 123 casE', { numbers: true, lower: true })
// Output: Title 123 Case
console.log(result)

Train case

import { trainCase } from 'string-filters'

let result = ''
result = trainCase('train 123 case')
// Output: Train-Case
console.log(result)

result = trainCase('train 123 case', { numbers: true })
// Output: Train-123-Case
console.log(result)

result = trainCase('traiN 123 casE', { lower: true })
// Output: Train-Case
console.log(result)

result = trainCase('traiN 123 casE', { numbers: true, lower: true })
// Output: Train-123-Case
console.log(result)

Truncate

import { truncate } from 'string-filters'

let result = truncate('etcetera', 3, '...')
// Output: etc...
console.log(result)

Author

License

This project is licensed under the MIT License - see the LICENSE file for details.