1.2.1 • Published 1 year ago

converto v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Converto

Converto is a lightweight TypeScript library for various conversion utilities.

Installation

npm install converto

Usage

You can import the functions in two ways: directly from the main package or from specific modules.

Import from the main package:

import { toCamelCase, numberWithCommas } from 'converto';

console.log(toCamelCase('hello-world')); // 'helloWorld'
console.log(numberWithCommas(1000000)); // '1,000,000'

Import from specific modules:

import { toCamelCase } from 'converto/string';
import { numberWithCommas } from 'converto/number';

console.log(toCamelCase('hello-world')); // 'helloWorld'
console.log(numberWithCommas(1000000)); // '1,000,000'

API

String Conversions

toCamelCase

Converts a string to camelCase.

toSnakeCase

Converts a string to snake_case.

toPascalCase

Converts a string to PascalCase.

toKebabCase

Converts a string to kebab-case.

toCapitalizedCase

Converts a string to Capitalized Case.

Number Conversions

numberWithCommas

Converts a number to a string with commas as thousand separators.

toBinaryString

Converts a number to its binary representation as a string.

toHexString

Converts a number to its hexadecimal representation as a string.

toOctalString

Converts a number to its octal representation as a string.

toPercentageString

Converts a number to a percentage string with a specified number of decimal places.

1.2.1

1 year ago

1.2.0

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago