metal-debounce is a utility library providing a debounce function, originally part of the deprecated Metal.js framework. It delays the execution of a function until a specified time has elapsed since its last invocation, a common pattern for optimizing event handlers (e.g., input, resize, scroll) by preventing excessive calls. The current stable version is 2.0.2, last published approximately seven years ago. As the Metal.js framework itself is no longer actively maintained for open-source releases, this package should be considered abandoned. It likely targets older JavaScript environments and CommonJS modules, lacking modern features like native ESM support or TypeScript definitions. Alternatives like `lodash.debounce` or `debounce-fn` offer more robust and actively maintained solutions.
npm install metal-debounceVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of the `debounce` function to limit repeated calls, such as from rapid user input.
Migrate to a currently maintained debounce utility like `lodash.debounce`, `debounce-fn`, or a modern framework's built-in debounce. These offer better support, performance, and often ESM compatibility.
Always use `require('metal-debounce')` to import the utility. For modern projects requiring ESM, consider alternative, actively maintained debounce libraries.While functional for basic debounce needs in older environments, developers should be aware of potential compatibility issues or the need for manual type declarations in TypeScript projects. Prefer modern alternatives for new development.
Ensure you are using `const debounce = require('metal-debounce');` to correctly import the function, as it's a direct export.Change your import statement to `const debounce = require('metal-debounce');`. If your project requires ESM, you must migrate to a different, actively maintained debounce library that explicitly supports ESM.No dependency data recorded yet.