🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

string-filters

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-filters

Fast native javascript string filters library.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
24
380%
Maintainers
1
Weekly downloads
 
Created
Source

Javascript String Filters

Fast native javascript string filters library.

Contents

  • Compatibility
  • Installation
  • Usage
  • Author
  • License

Compatibility

BrowserVersion
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', true)
// Output: camel123Case
console.log(result)

Capitalize

import { capitalize } from 'string-filters'

let result = capitalize('capitalizE')
// 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', 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', 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', 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.

Keywords

string

FAQs

Package last updated on 13 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts