@neabyte/utils-core
v0.2.0
Published
Zero-dependency utilities for modern development across all runtimes
Maintainers
Readme
Utils Core
Zero-dependency utilities for modern development across all runtimes.
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-corenpm:
npm install @neabyte/utils-coreCDN (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 buildTesting
Type check - format, lint, and type-check:
deno task checkUnit 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.
