@bnidev/js-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@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

Package Sidebar

Install

npm i @bnidev/js-utils

Weekly Downloads

65

Version

0.1.0

License

MIT

Unpacked Size

111 kB

Total Files

7

Last publish

Collaborators

  • bnidev