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

@pcg/text-kit

v1.0.0

Published

Helps you transform text and words programmatically

Readme

@deeepvision/textkit

@deeepvision/textkit is a text transformation and manipulation library that provides a collection of utility functions to help you work with strings effortlessly. This package is designed to simplify the process of changing cases, declination, pluralization, and more.

Features

  • Case conversion (PascalCase, camelCase, param-case, snake_case, CONSTANT_CASE)
  • Sentence transformation (to sentence, upper cased sentence, lower cased sentence)
  • Abbreviation generation
  • Declination based on number
  • Pluralization and singularization

Installation

Install the package using npm or yarn:

npm install @deeepvision/textkit

Usage

Import and use the desired functions from the package:

import {
  ucfirst,
  pascalCase,
  camelCase,
  // ...
  decline,
  singularToPlural,
  pluralToSingular,
} from '@deeepvision/textkit';

// Change cases
const upperFirstChar = ucfirst('hello');
const pascal = pascalCase('hello world');
const camel = camelCase('hello world');
// ...

// Declination
const declinedNoun = decline('apple', 3);

// Pluralization
const plural = singularToPlural('cat');
const singular = pluralToSingular('cats');

For a comprehensive list of available functions, please refer to the feature list provided in the package description.

API

Case conversion

ucfirst(string: string): string

Convert a string to string with the first character in uppercase.

ucfirst('hello world'); // Hello world
ucfirst('HELLO WORLD'); // Hello world

lcfirst(string: string): string

Convert a string to string with the first character in lower case.

lcfirst('Hello world'); // hello world

pascalCase(string: string): string

Convert a string to PascalCase.

pascalCase('simple') //=> "Simple"
pascalCase('some.dot.case') //=> "SomeDotCase"
pascalCase('some-param-case') //=> "SomeParamCase"
pascalCase('some spaced case') //=> "SomeSpacedCase"
pascalCase('someCamelCase')) //=> "SomeCamelCase"
pascalCase('SomePascalCase') //=> "SomePascalCase"

camelCase(string: string): string

Convert a string to camelCase.

camelCase('simple') //=> "simple"
camelCase('some.dot.case') //=> "someDotCase"
camelCase('some-param-case') //=> "someParamCase"
camelCase('some spaced case') //=> "someSpacedCase"
camelCase('someCamelCase')) //=> "someCamelCase"
camelCase('SomePascalCase') //=> "somePascalCase"

paramCase(string: string): string - Convert a string to param-case.

paramCase('simple') //=> "simple"
paramCase('some.dot.case') //=> "some-dot-case"
paramCase('some-param-case') //=> "some-param-case"
paramCase('some spaced case') //=> "some-spaced-case"
paramCase('someCamelCase')) //=> "some-camel-case"
paramCase('SomePascalCase') //=> "some-pascal-case"

snakeCase(string: string): string

Convert a string to snake_case.

camelCase('simple') //=> "simple"
camelCase('some.dot.case') //=> "some_dot_case"
camelCase('some-param-case') //=> "some_param_case"
camelCase('some spaced case') //=> "some_spaced_case"
camelCase('someCamelCase')) //=> "some_camel_case"
camelCase('SomePascalCase') //=> "some_pascal_case"

constantCase(string: string): string

Convert a string to CONSTANT_CASE.

constantCase('foo bar'); //=> 'FOO_BAR'
constantCase('foo_bar'); //=> 'FOO_BAR'
constantCase('foo-bar'); //=> 'FOO_BAR'
constantCase('foo.bar'); //=> 'FOO_BAR'
constantCase('fooBar'); //=> 'FOO_BAR'
constantCase('FooBar'); //=> 'FOO_BAR'

Sentence transformation

toSentence(string: string): string

Convert a string to sentence.

toSentence('foo bar'); //=> 'Foo bar'
toSentence('foo_bar'); //=> 'Foo bar'
toSentence('foo-bar'); //=> 'Foo bar'
toSentence('foo.bar'); //=> 'Foo bar'
toSentence('fooBar'); //=> 'Foo bar'
toSentence('FooBar'); //=> 'Foo bar'
toSentence('foo bar baz'); //=> 'Foo bar baz'

toUcSentence(string: string): string

Convert a string to upper cased sentence.

toUcSentence('foo bar'); //=> 'Foo Bar'
toUcSentence('foo_bar'); //=> 'Foo Bar'
toUcSentence('foo-bar'); //=> 'Foo Bar'
toUcSentence('foo.bar'); //=> 'Foo Bar'
toUcSentence('fooBar'); //=> 'Foo Bar'
toUcSentence('FooBar'); //=> 'Foo Bar'
toUcSentence('foo bar baz'); //=> 'Foo Bar Baz'

toLcSentence(string: string): string

Convert a string to lower cased sentence.

toLcSentence('foo bar'); //=> 'foo bar'
toLcSentence('foo_bar'); //=> 'foo bar'
toLcSentence('foo-bar'); //=> 'foo bar'
toLcSentence('foo.bar'); //=> 'foo bar'
toLcSentence('fooBar'); //=> 'foo bar'
toLcSentence('FooBar'); //=> 'foo bar'
toLcSentence('Foo bar baz'); //=> 'foo bar baz'

SQL alias and abbreviation

toSqlAlias(string: string): string

Convert a table name to SQL alias.

toSqlAlias('foo bar'); //=> 'fb'
toSqlAlias('book'); //=> 'b'
toSqlAlias('article-category'); //=> 'ac'

toAbbreviation(string: string): string

Convert a string to abbreviation.

toAbbreviation('Deep Vision'); //=> 'DV'
toAbbreviation('Рожеві окуляри', {
  lang: 'uk',
}); //=> 'RO'
toAbbreviation('Удивительные факты', {
  lang: 'ru'
}); //=> 'UF'
toAbbreviation('The very long title that can be shorter but I love long titles', {
  maxLength: 3
}); //=> 'TVL'
toAbbreviation('Vision'); //=> 'VSN'
toAbbreviation('Deep Vision', {
  iteration: 1,
}); //=> 'DV1'

Declination

decline(noun: string, number: number): string

Decline a noun based on a number.

const words = ['элемент', 'элемента', 'элементов'];

decline(0, words, false) // => 'элементов'
decline(24, words, false) // => 'элемента'
decline(21, words, false) // => 'элемент'

Pluralization

singularToPlural(singular: string): string

Change the plural form of a word to its singular form.

singularToPlural('book'); //=> 'books'

pluralToSingular(plural: string): string

Change the singular form of a word to its plural form.

pluralToSingular('books'); //=> 'book'