Skip to content

NeaByteLab/Utils-Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utils Core

Zero-dependency utilities for modern development across all runtimes.

Node Deno Bun CDN

Module type: Deno/ESM npm version JSR License

Features

  • Zero dependencies - No external packages required.
  • Async - Abortable sleep and promise timeout utilities with custom scheduler support.
  • Broadcast - Named-channel event bus with per-channel listener limits.
  • Clone - Deep and shallow cloning with structured clone fallback and custom handlers.
  • Immutable - Recursive freezing, hardening, and read-only Map/Set proxies.
  • Iterable - Lazy, chainable pipeline for iterables with map, filter, reduce, and more.
  • Sequential - Async function queue with configurable concurrency and backpressure control.
  • Signal - Typed event emitter with error-isolated listeners and max listener guards.
  • Store - Reactive state container with reducer updates and derived state support.

Installation

Note

Prerequisites: For Deno (install from deno.com). For npm use Node.js (e.g. nodejs.org).

Deno (JSR):

deno add jsr:@neabyte/utils-core

npm:

npm install @neabyte/utils-core

CDN (jsDelivr/unpkg/esm.sh):

<script type="module">
  import {
    createSignal
    // ...
  } from 'https://cdn.jsdelivr.net/npm/@neabyte/utils-core/dist/index.mjs'
</script>

Or via esm.sh:

<script type="module">
  import {
    createSignal
    // ...
  } from 'https://esm.sh/@neabyte/utils-core'
</script>

Or via importmap:

<script type="importmap">
  {
    "imports": {
      "@neabyte/utils-core": "https://cdn.jsdelivr.net/npm/@neabyte/utils-core/dist/index.mjs"
    }
  }
</script>
<script type="module">
  import { createSignal } from '@neabyte/utils-core'
</script>

Read docs/README.md for full documentation.

Build

npm build (bundles to dist/):

npm run build

Testing

Type check - format, lint, and type-check:

deno task check

Unit tests - format/lint tests and run all tests:

deno task test
  • Tests live under tests/ (async, broadcast, clone, immutable, iterable, sequential, signal, and store tests).
  • The test task uses --allow-read, --allow-write, and --allow-env.

Dev Notes

I struggled learning over the past several years without clear examples, so I wrote the simple stuff I kept rewriting across projects. Nothing fancy, just small utilities that do what they say. If they help you, cool. If you outgrow them, even better.

License

This project is licensed under the MIT license. See the LICENSE file for details.