@small-project/collection
v1.0.0
Published
Type-safe Collection utilities for JS/TS
Downloads
3
Readme
@small-project/collection
A lightweight, dependency-free TypeScript collection library offering convenient manipulation and transformation utilities for lists, maps, numbers, and strings.
Documentation
| Module | Description | |--------|--------------| | Collection | Base generic collection class | | NumberCollection | Mathematical utilities for numeric arrays | | StringCollection | String transformation and filtering tools |
🚀 Installation
npm install @small-project/collectionUsage Example
import NumberCollection from "@small-project/collection/dist/esm/collection/number-collection.js";
const nums = new NumberCollection([1, 2, 3, 4]);
console.log(nums.mean()); // 2.5
console.log(nums.multiply(2).values()); // [2, 4, 6, 8]Key Features
- 🔧 Type-safe and lightweight
- 🧮 Numeric operations (sum, mean, std, variance)
- 🔤 String operations (trim, case, slug, replace, etc.)
- 🧱 No dependencies
- ⚡ Ready for Node.js & ESM/CJS
📄 License
MIT License © 2025 Sébastien Kus
