This package provides a lightweight, vanilla JavaScript solution for autocomplete and autosuggest functionalities. Released in 2015, its current stable version is 1.0.4, last updated in February 2016. It distinguishes itself by having no external dependencies, a small footprint (less than 2.4 KB gzipped), and extensive browser support down to Internet Explorer 8+. It was developed by Pixabay.com and features a flexible data source, smart caching, configurable delay, and minimum character settings. Its release cadence was short-lived, with the last update nearly a decade ago, indicating it is no longer actively maintained. While functional for its intended environment, it lacks modern JavaScript ecosystem integrations.
npm install pixabay-javascript-autocompleteVerified import paths — ran on the pinned version, not inferred.
This HTML example demonstrates how to include the `autocomplete.min.js` script and initialize the `autoComplete` constructor on an input field with a static data source.
For new projects or applications requiring ongoing support and modern features, consider using a more actively maintained autocomplete library.
For modern build environments, you may need to load it as a global script and expose it via a custom entry point, or use a shim. Alternatively, opt for an autocomplete library built for modular JavaScript.
If accessibility, type safety, or cutting-edge browser features are critical, evaluate newer alternatives. You would need to provide custom TypeScript declarations if using TypeScript.
Avoid using this library directly with modern JavaScript frameworks unless you implement careful encapsulation and manual DOM management within the framework's lifecycle, which is generally discouraged.
Ensure the `<script src="path/to/autocomplete.min.js"></script>` tag is correctly placed in your HTML, preferably before any script attempting to use `new autoComplete()`, typically at the end of the `<body>`.
Provide a valid CSS selector string (e.g., `'#my-input'`) or a direct DOM element reference for the `selector` option when initializing `autoComplete`.
Set the `source` option to an array of possible suggestion strings (e.g., `['apple', 'banana']`) or a function that asynchronously or synchronously calls `suggest(matches)`.
No dependency data recorded yet.