Iterall is a minimalist, zero-dependency utility library designed to enable the use of JavaScript Iterables and AsyncIterables across all JavaScript environments, including older versions of Internet Explorer. It provides crucial helpers for libraries that wish to accept various iterable inputs (like Arrays, Maps, Sets, NodeLists, TypedArrays, or custom data structures) instead of being limited to only Arrays. The current stable version is 1.3.0, and the project maintains a steady release cadence with improvements to TypeScript definitions and async iterator support. Its key differentiators include its tiny footprint (under 1KB gzipped), its 'library for libraries' approach, and its robust compatibility with both modern and legacy JavaScript runtimes through its intelligent fallback mechanism for `Symbol.iterator`.
npm install iterallVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `isCollection` to check for iterable/array-like structures and `forEach` for synchronous iteration, along with `forAwaitEach` for handling asynchronous iterables, all compatible across environments.
Assess your target environment compatibility. If only modern ES environments are targeted, native `for...of` loops and `Array.from` might suffice. Otherwise, `iterall` is beneficial for broader compatibility.
Check your bundler configuration (e.g., `resolve.extensions` in Webpack) to ensure `.mjs` is included. For Node.js, ensure your `package.json` specifies `type: 'module'` or uses `.mjs` extensions for ESM files.
If using `forAwaitEach` for asynchronous iteration, ensure your project depends on `iterall` version `1.1.3` or newer to avoid memory leaks and unhandled promise rejections.
Use `iterall.forEach(myIterable, callback)` or `iterall.isIterable(myIterable)` to ensure compatibility across all environments, as `iterall` handles the fallback to `@@iterator`.
Change your import statements to CommonJS `require` syntax: `const { forEach } = require('iterall');` or configure your Node.js project or build pipeline to support ESM.Verify `iterall` is correctly installed in `node_modules`. If using a bundler, ensure its configuration supports resolving `.mjs` files (e.g., `resolve.extensions` in Webpack should include `'.mjs'`).
No dependency data recorded yet.