@jstiehl/alternating-case
v1.0.1
Published
Convert text to alternating uppercase and lowercase letters
Readme
@jstiehl/alternating-case
Convert text to alternating uppercase and lowercase letters.
Installation
npm install @jstiehl/alternating-case
# or using yarn
yarn add @jstiehl/alternating-caseUsage
ESM
import { alternatingCase } from "@jstiehl/alternating-case";
console.log(alternatingCase("hello world"));
// Output: HeLlO WoRlD
console.log(alternatingCase("hello world", { start: "lower" }));
// Output: hElLo wOrLdAPI
alternatingCase(input: string, options?: { start?: "upper" | "lower" }): string
| Option | Type | Default | Description | |
| ------- | -------- | -------- | ----------- | -------------------------------------------------------------------------- |
| start | "upper" | "lower" | "upper" | Choose whether the alternating sequence starts with uppercase or lowercase |
input: The string to convert- Returns: A string with alternating letter case
Types
- Fully typed for TypeScript
- Import types automatically from:
import { alternatingCase } from "@jstiehl/alternating-case";License
MIT © James Stiehl
