# @keeex/utils

> Various utility functions for pure JavaScript

Latest version **7.6.5** (published 2026-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @keeex/utils
pnpm add @keeex/utils
yarn add @keeex/utils
bun add @keeex/utils
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 7.6.5 |
| Published | 2026-09-03 |
| First published | 2025-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 6 |
| Unpacked size | 922.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | KeeeX SAS |
| Maintainers | marc-keeex, cley_faye, keeex_jenkins |
| Keywords | utility |

## Links

- npm: https://www.npmjs.com/package/@keeex/utils
- Repository: https://devtools.keeex.me:222/KeeeX/js-utils
- Homepage: https://devtools.keeex.me/gitea/KeeeX/js-utils
- npm.io page: https://npm.io/package/@keeex/utils

## Dependencies (6)

- [ms](https://npm.io/package/ms.md) ^2.1.3
- [@keeex/log](https://npm.io/package/@keeex/log.md) ^1.10.1
- [cron-parser](https://npm.io/package/cron-parser.md) ^5.10.0
- [base64-arraybuffer](https://npm.io/package/base64-arraybuffer.md) ^1.0.2
- [text-encoding-shim](https://npm.io/package/text-encoding-shim.md) ^1.0.5
- [@keeex/bubble_babble](https://npm.io/package/@keeex/bubble_babble.md) ^3.0.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 7.6.5 (latest) — 2026-09-03
- 7.6.4 — 2026-09-03
- 7.6.3 — 2026-08-26
- 7.6.2 — 2026-02-13
- 7.6.1 — 2026-02-09
- 7.6.0 — 2026-01-06
- 7.5.0 — 2025-12-22
- 7.4.0 — 2025-08-11
- 7.3.0 — 2025-08-04
- 7.2.1 — 2025-06-04
- 7.2.0 — 2025-05-20
- 7.1.0 — 2025-05-20
- 7.0.3 — 2025-04-18
- 7.0.2 — 2025-04-08
- 7.0.1 — 2025-04-04

## README

# @keeex/utils

[![Bugs](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=bugs&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)
[![Code Smells](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=code_smells&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)
[![Maintainability Rating](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=sqale_rating&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)
[![Security Rating](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=security_rating&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)
[![Vulnerabilities](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=vulnerabilities&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)
[![Technical Debt](https://sast.keeex.net/api/project_badges/measure?project=js-utils&metric=sqale_index&token=e59f2b94ce10dbfc7c7ee6de462eca11c95f9127)](https://sast.keeex.net/dashboard?id=js-utils)

- [Gitea](https://forge.keeex.me/KeeeX/js-utils)
- [SonarQube](https://sast.keeex.net/dashboard?id=js-utils)

Utility functions in pure JS used in many places.

You should check the API documentation for detailed informations about each functions.
This is a general feature list overview.

## React-Native

When using in React-Native environment, you must install the `core-js@3` dependency.

## Async utility

Stuff related to promises and async operations.

- `AsyncTrigger`, for easy debouncing
- `DeferredPromise` to manipulate the usual `resolve()` and `reject()` functions outside of a
  promise block
- `KeyCache` to create a basic key-value cache with asynchronous fetch
- `Queues` to create parallel queues of tasks
- `TimeCache` to create a cache that keeps a value for a given amount of time and can automatically
  refresh it

## CRON

Time-based task scheduling.

## Marshalling

Serialization of random data into byte buffers.

## Types

Various type-checking helpers to create TypeScript type predicates.
Supports "shortcut" versions for performance after a full check was done.

## Array

Generic operations on arrays, as well as array coercion.

## Uint8Array and ArrayBuffer

Conversion between different formats and search in buffer functions.

## base58, base64

Utility to manipulate strings encoded in these formats.

## benchmark

Code to run a JavaScript function a lot to get performance benchmarks.
Includes some form of "automatic" probing to get good average values.

## bytebuffer

Helper wrapping JavaScript DataView into convenient functions.

## dict

Functions to copy records with primitive types (deep copy).
These functions can probably be replaced with `Object.assign()` or custom code.

## error

Coerce anything (`unknown`) into an `Error` object for easier error handling.

## global

Functions to use a JavaScript environment "global" dataset.
Handles multiple environment somewhat gracefully.

## hex

Hex string manipulation.

## idx

IDX check and manipulation functions

## json

JSON parsing with type safety.
Also, a "canonical" JSON encoder that ensure property order is consistent.

## line buffer

Buffer string inputs and output full lines only.

## number

Manipulate number.
Currently only round to a given decimal place.

## path

Generic filename sanitization.

## promise

Helpers around promises.

- controlled async delay
- retry a promise until it succeed (with max tries)
- run an array of promise, stop at the first that succeed
- silently drop a promise without crashing the VM

## starttime

Get the elapsed time since the JavaScript environment started.

## string

String and UTF-8 manipulations.

## units

Convers between various units.
Generic functions are available as well as byte and time conversions.

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