# string-library-pr

> prototype library to string

Latest version **1.1.5** (published 2021-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install string-library-pr
pnpm add string-library-pr
yarn add string-library-pr
bun add string-library-pr
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2021-03-05 |
| First published | 2021-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 49.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yevhenii Kleshchev |
| Maintainers | dasx10 |
| Keywords | string, prototype |

## Links

- npm: https://www.npmjs.com/package/string-library-pr
- Repository: https://github.com/dasx10/string-library-pr
- Homepage: https://github.com/dasx10/string-library-pr#readme
- Issues: https://github.com/dasx10/string-library-pr/issues
- npm.io page: https://npm.io/package/string-library-pr

## 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.1.5 (latest) — 2021-03-05
- 1.1.4 — 2021-03-05
- 1.1.3 — 2021-03-05
- 1.1.2 — 2021-03-05
- 1.1.1 — 2021-03-05
- 1.1.0 — 2021-03-05
- 1.0.1 — 2021-03-05
- 1.0.0 — 2021-03-05

## README

# string library prototype

## install

```
npm i string-library-pr
```

or

```
<script src="https://unpkg.com/string-library-pr@1.1.0/index.js" />
```

if use `TypeScript`
this has types

```
import 'string-library-pr/@types';
```

## use

```
require('string-library-pr');

```

if emj or module

```
import 'string-library-pr';
```

## example

```
'abcd ab'.toCapitalize() // 'Abcd ab'
'abcd ab'.toCapitalizeAll() // 'Abcd Ab'

'abcd'.limit(2) // 'ab'
'abcd ab'.reverse() // 'ba dcba'
'abcd ab'.reverse().toCapitalize() // 'Ba dcba'

'abcd'.repeat() // 'abcdabcd'
'abcd'.repeat(1) // 'abcdabcd'
'abcd'.repeat(3) // 'abcdabcdabcdabcd'
'abcd'.repeat(0) // 'abcd'
'abcd'.repeat(-1) // 'abcd'

'abcda'.count() // 5
'abcda'.count('a') // 2
'abcda'.count('b') // 1
'abcda'.count('z') // 0

''.isEmpty() // true
'    '.isEmpty() // true
'    \t'.isEmpty() // true
'  \n  \t'.isEmpty() // true
'  \n a \t'.isEmpty() // false

'root'.toRegEx() // /root/
'root'.toRegEx('gi') // /root/gi

'[1,2]'.toJson() // [object Array]

'aabb'.toSplit(2) // ['aa','bb']
'aabb'.toSplit(4) // ['a','a','b','b']
'aabb'.toSplit(5) // ['a','a','b','b']
'aabb'.toSplit(3) // ['aa','b','b']


'abcd'.toCharCodes() // Int32Array(4) [ 97, 98, 99, 100 ]


'ab'.log() // output to console 'ab' this equal console.log('ab')
```

## example method into interface

```
interface String {
    log():string;

    toCamelCase(symbol?:string):string;
    toCapitalizeAll():string;
    toCapitalize():string;

	repeat(count?:number):string;
    reverse():string;
    limit():string;

    count(string?:string):number;
    countLines():number;
    countSpaces():number;
    countTags(tagName?:string):number;
	countNumbers(number?:number|string|RegExp):number;

	getElementByTagName(tagName:string):string

    isEmpty():boolean;
	isPalindrome():boolean;
	isEmail():boolean;
	isUrl():boolean;
	isWord():boolean;
	isJson():boolean;

	isHasNumbers():boolean;
	isHasEmails():boolean;
	isHasUrls():boolean;

    toRegExp(RegExpFlags?:string):RegExp;
    toJson():string|object;

    toSplit(n?:number):Array<string>;

    toCharCodes():Int32Array;
}
```

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