# @smitpatelx/string-utils

> - A string utility library - Small size - Stat size: 2.33 KB - Parsed size: 1.03 KB - Gzipped size: 515 B - Simple

Latest version **1.0.1** (published 2022-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @smitpatelx/string-utils
pnpm add @smitpatelx/string-utils
yarn add @smitpatelx/string-utils
bun add @smitpatelx/string-utils
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-02-21 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | smitpatelx |
| Maintainers | smitpatelx |
| Keywords | string utils, string utilities, string, utilities, utils |

## Links

- npm: https://www.npmjs.com/package/@smitpatelx/string-utils
- Repository: https://github.com/smitpatelx/string-utils
- Homepage: https://github.com/smitpatelx/string-utils#readme
- Issues: https://github.com/smitpatelx/string-utils/issues
- npm.io page: https://npm.io/package/@smitpatelx/string-utils

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-02-21
- 1.0.0 — 2022-02-08
- 0.0.2 — 2022-02-08
- 0.0.1 — 2022-02-08

## README

# String Utils
- A string utility library
- Small size
  - Stat size: 2.33 KB
  - Parsed size: 1.03 KB
  - Gzipped size: 515 B
- Simple

![VERSION](https://img.shields.io/npm/v/@smitpatelx/string-utils)
![MONTHLY_DOWNLOADS](https://img.shields.io/npm/dm/@smitpatelx/string-utils)
![NPM](https://img.shields.io/npm/l/@smitpatelx/string-utils?color=blue)

# Contribution
This is an open-source project, feel free to contribute to this awesome project.<br/>
Best way to do this: 
  1. Fork the project
  2. Create a branch `<current_version>-<github_username>-<keyword>`. Example: `1.0.0-smitpatelx-changesToIsEmpty`
  3. Make a pull request
  4. Make sure not to change version in package.json (That will be done in next release)

# Installation
- NPM 
```js
  npm i @smitpatelx/string-utils
```
- Yarn
```js
  yarn add @smitpatelx/string-utils
```
- CDN
```html
  <script src="https://cdn.jsdelivr.net/npm/@smitpatelx/string-utils@latest/src/lib/string-utils.js"></script>
```
- [Codepen](https://codepen.io/smitpatelx/full/XWzRovO/)

# Use
```js
import {
    left,
    right,
    camelize,
    capitalize,
    removeWhiteSpace,
    escapeHtml,
    isEmpty,
    slugify
} from '@smitpatelx/string-utils';
```

# Examples
#### Right
```js
right('111 222 333 444 000', 3)

// Output
000
```

#### Left
```js
left('111 222 333 444 000', 3)

// Output
111
```

#### Camelize
```js
camelize('data_rate')
camelize('-git-xyz')

// Output
dataRate
GitXyz
```

#### Capitalize
```js
capitalize('data')
capitalize('aPPLE')

// Output
Data
Apple
```

#### RemoveWhiteSpace
```js
removeWhiteSpace('111\n222\t333\n444\n\t000')
removeWhiteSpace('  This   \t is awesome   \n\n\t library\n!  ')

// Output
111 222 333 444 000
This is awesome library !
```

#### EscapeHtml
```js
escapeHtml('<div>stringUtils</div>')

// Output
&lt;div&gt;stringUtils&lt;/div&gt;
```

#### isEmpty
```js
isEmpty('')
isEmpty('hi')

// Output
true
false
```

#### slugify
```js
slugify('Save earth')
slugify('Crème brûlée')

// Output
save-earth
creme-brulee
```

---
_Source: https://npm.io/package/@smitpatelx/string-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
