# @kiyotd/kurage-utils

> Collection of utility functions.

Latest version **0.1.4** (published 2023-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kiyotd/kurage-utils
pnpm add @kiyotd/kurage-utils
yarn add @kiyotd/kurage-utils
bun add @kiyotd/kurage-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.1.4 |
| Published | 2023-12-07 |
| First published | 2023-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | kiyotd |

## Links

- npm: https://www.npmjs.com/package/@kiyotd/kurage-utils
- Repository: https://github.com/kiyotd/kurage-utils
- Homepage: https://kiyotd-kurage.vercel.app/
- Issues: https://github.com/kiyotd/kurage/issues
- npm.io page: https://npm.io/package/@kiyotd/kurage-utils

## Recent versions

- 0.1.4 (latest) — 2023-12-07
- 0.1.2 — 2023-10-22

## README

# Kurage Utils

Collection of utility functions.

<img src="https://github.com/kiyotd/kurage/assets/41136135/2e429270-6fa5-43f5-98be-de590d927688" width="100%" >

## Installation

```bash
npm i @kiyotd/kurage-utils
```

```bash
yarn add @kiyotd/kurage-utils
```

```bash
pnpm add @kiyotd/kurage-utils
```

<!--
CDN

```shell
<script src="https://unpkg.com/@kiyotd/kurage-utils@latest/dist/index.js"></script>
```
-->

## Examples

- NumberUtils.map

  数値を別の範囲にマッピング

    ```typescript
    import { NumberUtils } from "@kiyotd/kurage-utils";
    
    // 元の範囲が0から100で、新しい範囲が0から1の場合
    NumberUtil.map(50, 0, 100, 0, 1) // 0.5
  
    // 元の範囲が0から100で、新しい範囲が0から10の場合
    NumberUtil.map(50, 0, 100, 0, 10) // 5
    ```

- calculateRgbaForOpacity

  透明度を考慮したRGBA値を計算

    ```typescript
    import { calculateRgbaForOpacity } from '@kiyotd/kurage-utils';

    // "rgb(80,209,173)" に限りなく近い色で、透明度を 0.75 にした場合の RGBA 値を取得
    calculateRgbaForOpacity('80,209,173', 0.75); // rgba(22,194,146,0.75)
   
    // "#50d1ad" に限りなく近い色で、透明度を 0.75 にした場合の RGBA 値を取得  
    calculateRgbaForOpacity('#50d1ad', 0.8); // rgba(22,194,146,0.75)
    ```

<!--
- kebabCaseToCamelCase

  ケバブケースをキャメルケースに変換
    ```typescript
    import { kebabCaseToCamelCase } from "@kiyotd/kurage-utils";
    
    kebabCaseToCamelCase("set-user-name"); // setUserName
    ```

- camelCaseToKebabCase

  キャメルケースをケバブケースに変換

    ```typescript
    import { camelCaseToKebabCase } from "@kiyotd/kurage-utils";
    
    camelCaseToKebabCase("setUserName"); // set-user-name
    ```

- isEmail

  Emailアドレスのバリデーション

    ```typescript
    import { isEmail } from "@kiyotd/kurage-utils";
    
    isEmail("example@example.com"); // true
    isEmail("example@exam@ple.com"); // false
    ```

- isIPv4

  IPv4アドレスのバリデーション

    ```typescript
    import { isIPv4 } from "@kiyotd/kurage-utils";
    
    isIPv4("255.255.255.255"); // true
    isIPv4("255.255.255.256"); // false
    ```

他の関数は [ドキュメント](https://kurage-utils.vercel.app/) を参照してください。
-->

etc...

## Documentation

[kurage-utils.vercel.app](https://kurage-utils.vercel.app/)

## License

MIT

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