Introduction
The@zayne-labs/toolkit-core package provides a collection of utility functions, state management solutions, and composable helpers designed for building robust web applications. It offers zero-dependency utilities (except for type helpers) optimized for performance and developer experience.
Installation
Package Features
The core package is organized into several categories:Async Utilities
Debouncing, throttling, promises, and timing utilities
State Management
Lightweight stores for app state, localStorage, and location management
DOM Utilities
Browser APIs, event handling, scroll management, and more
General Utilities
Object manipulation, JSON parsing, and helper functions
Quick Start
Here’s a simple example using some of the core utilities:TypeScript Support
All utilities are written in TypeScript with comprehensive type definitions. The package provides excellent type inference and safety:The toolkit-core package requires Node.js 18.x or higher and is optimized for modern JavaScript environments.
Bundle Size
The entire package is designed to be lightweight with a size limit of ~6.5kb. Individual utilities are tree-shakeable, so you only bundle what you use.Browser Compatibility
Most utilities work in modern browsers that support ES2020+. DOM-specific utilities require a browser environment and include runtime checks for SSR compatibility.Next Steps
Explore Utilities
Learn about object manipulation and helper functions
State Management
Build reactive applications with stores
Async Utilities
Master debouncing, throttling, and promises
DOM Utilities
Work with browser APIs and DOM manipulation