# kariu-utils

> Javascript funtions

Latest version **0.0.4** (published 2023-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install kariu-utils
pnpm add kariu-utils
yarn add kariu-utils
bun add kariu-utils
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2023-07-02 |
| First published | 2022-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lebloisaurore |
| Maintainers | auroreleblois |

## Links

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

## Recent versions

- 0.0.4 (latest) — 2023-07-02
- 0.0.3 — 2022-10-15
- 0.0.2 — 2022-01-27

## README

# kariu-utils

## Basics:

`npm i kariu-utils`

## How to use:

`import { functionName } from kariu-utils`

## Example:

```
import { array, string, dom, math } from 'kariu-utils';
console.log(string.toBoolean('true'));

```

## array functions:

1. useFilter(arrayOfObject, filterKeys, allFilterKeys = [] ) :
   This function will filter your array of objects and return a new one.

- arrayOfObject: your array to filter.
- filterKeys: your object of filters. ex: { search: 'plop', id: [5, 8, 9]}. The keyword "search" will look for string within the allFilterKeys param if given or your entire array.

- allFilterKeys: optional. if given, will only filter within given range.

2. useSort(array, key, order):
   The function will sort your array according to your desire.

- array: your array of objects.
- key: the key given will order the results.
  ex: useSort( [{id: 2, name: "second"}, {id: 1, name: "first"}], "id", "desc") => [{id: 1, name: "first"}, {id: 2, name: "second"}]
- order: only accepts "desc" or "asc".

## string functions:

1. capitalize(string):
   ex : string.capitalise('test') => Test.
2. getByteLength(string)
3. isJson(string)
4. isEmail(string)
5. removeAccents(string)
6. removeSpecialChar(string)
7. replaceWhiteSpaces(string, replacement: string)
8. toBoolean(string)
9. escapeEmoji(string) => will prevent emoji insertion in your string :)

## dom functions:

1. getPosRelativeTo(refFrom, refToRect)

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