yapool is a minimalist JavaScript object pooling library, currently at version 1.0.0. It provides a basic linked-list implementation for managing reusable objects, focusing on extreme simplicity over feature richness. Unlike more comprehensive alternatives, yapool offers a 'dead-simple' API for adding and removing objects. Its primary differentiator is its minimal footprint and straightforward approach, making it suitable for scenarios where `n` (the number of objects in the pool) is small. Developers should be aware that operations like `remove` have `O(n)` complexity, which limits its applicability for very large lists. Given its simplicity and the project's age (last published in 2014), its release cadence is very stable or infrequent, suggesting a maintenance-only status rather than active feature development.
npm install yapoolVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing a new Pool, adding and removing objects, and checking the pool's length.
For large pools or performance-critical applications, consider object pool implementations backed by hash maps or other data structures that offer `O(1)` or `O(log n)` average-case performance for lookups and deletions.
Evaluate if yapool's minimal API meets your needs. For more advanced pooling scenarios, look for libraries that offer factory functions, max limits, and lifecycle hooks.
Use `import Pool from 'yapool'` when consuming in an ESM project. Be aware that older CommonJS modules might affect modern build optimizations. If strict ESM compatibility or advanced bundling is critical, consider a natively ESM object pool.
Ensure you are using the correct import syntax for a CommonJS default export in ESM: `import Pool from 'yapool';`. If in CommonJS, use `const Pool = require('yapool');`.Install the package using npm: `npm install yapool`. Verify the package name in your `package.json` and in your `import` or `require` statement.
No dependency data recorded yet.