Skip to content

A collection of modern, typed JavaScript utility functions for working with arrays, DOM elements, objects, and timing.

License

Notifications You must be signed in to change notification settings

bnidev/js-utils

Repository files navigation

@bnidev/js-utils

A collection of modern, typed JavaScript utility functions for working with arrays, DOM elements, objects, and timing.

npm version License: MIT CI

✨ Features

  • ✅ Fully typed with TypeScript
  • 📦 Tree-shakable (ESM support)
  • 🧩 Modular structure (array, DOM, object, validation, etc.)
  • 📚 Auto-generated documentation via TypeDoc
  • 🧪 Tested with Vitest

📦 Installation

npm

npm install @bnidev/js-utils

pnpm

pnpm add @bnidev/js-utils

yarn

yarn add @bnidev/js-utils

🛠 Usage

import { debounceFn, flattenArray, deepClone } from "@bnidev/js-utils";

// Debounce any function
const log = (val: string) => console.log(val);
const debouncedLog = debounceFn(log, 300);

// Flatten nested arrays
flattenArray([1, [2, 3], [[4]], 5]); // → [1, 2, 3, 4, 5]

// Deep clone objects
const copy = deepClone({ a: { b: 1 } });

📚 Documentation

You can find the full documentation for all utility functions, including parameters and return types here:
👉 View full documentation

Generated automatically using TypeDoc.

🧪 Development & Testing

Run lint and formatting checks:

pnpm run check

Run lint and formatting checks & autofix if possible:

pnpm run check:fix

Run tests with coverage report:

pnpm run test:coverage

Build the package:

pnpm run build

Generate docs:

pnpm run docs:build

About

A collection of modern, typed JavaScript utility functions for working with arrays, DOM elements, objects, and timing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •