# help-my-strings

> String utility functions such as titleize, capitalize, pluralize etc

Latest version **2.0.3** (published 2019-10-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install help-my-strings
pnpm add help-my-strings
yarn add help-my-strings
bun add help-my-strings
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2019-10-16 |
| First published | 2017-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | cd2developers, hexmodr, smosix |

## Links

- npm: https://www.npmjs.com/package/help-my-strings
- Repository: https://github.com/CD2/HelpMyStrings
- Homepage: https://github.com/CD2/HelpMyStrings#readme
- Issues: https://github.com/CD2/HelpMyStrings/issues
- npm.io page: https://npm.io/package/help-my-strings

## Dependencies (3)

- [jest](https://npm.io/package/jest.md) ^22.4.3
- [pluralize](https://npm.io/package/pluralize.md) ^7.0.0
- [@types/node](https://npm.io/package/@types/node.md) ^12.7.8

## Recent versions

- 2.0.3 (latest) — 2019-10-16
- 2.0.2 — 2019-10-01
- 2.0.1 — 2019-10-01
- 2.0.0 — 2019-09-30
- 1.0.10 — 2018-04-13
- 1.1.11 — 2018-04-09
- 1.1.10 — 2018-03-12
- 1.0.9 — 2018-03-12
- 1.0.8 — 2018-03-08
- 1.0.7 — 2018-03-08
- 1.0.6 — 2018-01-05
- 1.0.5 — 2018-01-05
- 1.0.4 — 2018-01-03
- 1.0.3 — 2018-01-03
- 1.0.2 — 2018-01-02
- … 2 more at https://npm.io/package/help-my-strings/versions

## README

[![CircleCI](https://circleci.com/gh/CD2/HelpMyStrings.svg?style=svg&circle-token=f36a7056438d44f471a2363a019f924e4291ee5c)](https://circleci.com/gh/CD2/HelpMyStrings)

![logo](logo.png)


## Capitalize

returns a string with only the first letter capitalized

```javascript
capitalize("hello world") // => Hello world
capitalize("HellO WOrLd") // => Hello world
capitalize("HELLOWORLD") // => Helloworld
```

## Humanize

returns a string suitable for human consumption

```javascript
humanize("hello_world") // => hello world
humanize("RenderHtml") // => Render Html
humanize("HTMLRender") // => HTML Render

```

## Titalize

returns a string in title format

```javascript
titalize("hello world") // => Hello World
titalize("hello_world") // => Hello World
titalize("HelloWorld") // => Hello World

```

## Truncate

returns a truncated string

<b>truncate</b>(string, {omission?, length?, separator?})

|   Option    | Purpose       | default   |
| ------------- | ------------- | -------   |
| omission      | Replaces the truncated content  | ...  |
| length        | The total length of the truncated content, including omission characters  | 20        |
| separator     | Defines the separator between words. Will stop at the last seperator if a word is broken by truncation | undefined |  

```javascript
truncate("Hello my name is James") // => Hello my name is ...
truncate("hello my name is James", { omission: "???", length: 10 }) // => Hello m???
truncate("hello my name is James", { length: 10, separator: " " }) // => Hello...
truncate("hello my name is James", { length: 11, separator: " " }) // => Hello my...

```

## CamelCase

returns a string in camel case with option to capitalise first letter

```javascript
camelCase("hello_world") // => helloWorld
camelCase("hello-world") // => helloWorld
camelCase("hello.world-bear") // => helloWorldBear
camelCase("hello_world", true) // => HelloWorld
```


## Singularize

returns the singular of the word

```javascript
singularize("words") // => word
singularize("people") // => person
singularize("car") // => car
```

## Pluralize

returns a pluralised word

```javascript
pluralize("cat") // => cats
pluraliz("person") // => people

pluralize(0, "thing") // => 0 things
pluralize(1, "thing") // => 1 thing
pluralize(2, "thing") // => 2 things
pluralize(1, "thing" undefined, { noCount: true }) // => thing
pluralize(2, "thing" undefined, { noCount: true }) // => things
```

## SnakeCase

returns a string in snake case

```javascript
snakeCase("words are cool") // => words_are_cool
snakeCase("Words-Are-Cool") // => words_are_cool
```

## Parameterize

returns a string in a parameterized form, suitable for URL slugs

```javascript
parameterize("hello world") // => hello-world
parameterize("hello.world") // => helloworld
parameterize("hello world.bear") // => hello-worldbear
```

---
_Source: https://npm.io/package/help-my-strings · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
