Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

text-transform

timnovis54MIT0.1.2TypeScript support: included

A microlibrary to transform strings with CSS-like properties

text, transform, text transform

readme

text-transform

Tiny library to transform text with CSS-like properties. Great for transforming text in environments whre the full CSS spec might not be available to you, such as Node.js or React Native.

Get Started

npm i text-transform
import { textTransform } from 'text-transform';

Or if you're not using ES6 imports, you can require like so:

const { textTransform } = require('text-transform');

Usage

// textTransform(text: string, type: string);
let a = textTransform('My String', 'uppercase');
// MY STRING

Available Types

  • uppercase - Converts all to uppercase
  • lowercase - Converts all to lowercase
  • title - Capitalizes first letter of each word in string
  • capitalize - Capitalizes first letter of string
  • initial - Returns original string