{"id":16296,"library":"awesomplete","title":"Awesomplete","description":"Awesomplete is an ultra-lightweight, customizable, and dependency-free autocomplete widget designed for modern browsers. It provides an accessible solution for adding suggestion lists to input fields, aiming to fill the gap where native `<datalist>` elements might fall short in customization or functionality. The current stable version is 1.1.7, which was last published to npm in 2018. While effective for its intended purpose, the project appears to be unmaintained, with no significant updates or active development in recent years. Its key differentiators include its minimal footprint (2KB minified & gzipped), zero dependencies, and the ability to be easily integrated via HTML attributes or a simple JavaScript API, offering flexibility for various use cases.","status":"abandoned","version":"1.1.7","language":"javascript","source_language":"en","source_url":"https://github.com/LeaVerou/awesomplete","tags":["javascript"],"install":[{"cmd":"npm install awesomplete","lang":"bash","label":"npm"},{"cmd":"yarn add awesomplete","lang":"bash","label":"yarn"},{"cmd":"pnpm add awesomplete","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Awesomplete is primarily accessed as a global object after including its script via a <script> tag in HTML. This is the intended and most common usage pattern.","symbol":"Awesomplete","correct":"<!-- In HTML, after awesomplete.js is loaded -->\n<script>\n  const input = document.querySelector('.awesomplete-input');\n  const awesomplete = new Awesomplete(input, {\n    list: ['Apple', 'Banana', 'Cherry']\n  });\n</script>"},{"note":"While `awesomplete.js` is set as the `main` entry in `package.json`, enabling CommonJS `require`, the library does not provide native ES module exports. Attempting to use `import` without bundler configuration will likely fail.","wrong":"import Awesomplete from 'awesomplete';","symbol":"Awesomplete","correct":"const Awesomplete = require('awesomplete');\n// Then use `new Awesomplete(...)`"},{"note":"For basic setup, direct HTML inclusion of the CSS and JS files is the most reliable method, especially in non-bundler environments. Relying on module imports for CSS/JS requires appropriate bundler loaders/plugins.","wrong":"import 'awesomplete/awesomplete.css'; // May not work depending on bundler config\nimport 'awesomplete/awesomplete.js';","symbol":"CSS and JS","correct":"<link rel=\"stylesheet\" href=\"path/to/awesomplete.css\" />\n<script src=\"path/to/awesomplete.js\" async></script>"}],"quickstart":{"code":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Awesomplete Quickstart</title>\n  <link rel=\"stylesheet\" href=\"https://unpkg.com/awesomplete@1.1.7/awesomplete.css\" />\n</head>\n<body>\n  <h1>Awesome Autocomplete</h1>\n\n  <label for=\"my-input\">Select a Programming Language:</label>\n  <input id=\"my-input\" class=\"awesomplete\" data-list=\"Ada, Java, JavaScript, Brainfuck, LOLCODE, Node.js, Ruby on Rails\" />\n\n  <h2>Programmatic Example</h2>\n  <label for=\"custom-input\">Choose a Fruit:</label>\n  <input id=\"custom-input\" />\n\n  <script src=\"https://unpkg.com/awesomplete@1.1.7/awesomplete.js\" async></script>\n  <script>\n    window.addEventListener('load', () => {\n      // Example 1: Declarative setup using HTML attributes (data-list)\n      // The input with class=\"awesomplete\" and data-list is automatically processed.\n\n      // Example 2: Programmatic setup for more control\n      const inputCustom = document.getElementById('custom-input');\n      new Awesomplete(inputCustom, {\n        list: [\n          'Apple', 'Apricot', 'Avocado', 'Banana', 'Blackberry', 'Blueberry',\n          'Cherry', 'Coconut', 'Cranberry', 'Date', 'Dragonfruit', 'Durian',\n          'Elderberry', 'Fig', 'Grape', 'Guava', 'Kiwi', 'Lemon', 'Lime',\n          'Mango', 'Melon', 'Nectarine', 'Orange', 'Papaya', 'Passion Fruit',\n          'Peach', 'Pear', 'Pineapple', 'Plum', 'Pomegranate', 'Raspberry',\n          'Strawberry', 'Watermelon'\n        ],\n        minChars: 1, // Show suggestions after 1 character\n        autoFirst: true // Highlight the first item automatically\n      });\n\n      // Event listener example (optional)\n      inputCustom.addEventListener('awesomplete-selectcomplete', (e) => {\n        console.log('Selected:', e.text.value);\n      });\n    });\n  </script>\n</body>\n</html>","lang":"javascript","description":"This quickstart demonstrates both declarative HTML-based setup with `data-list` and programmatic JavaScript instantiation for an autocomplete input, showing how to link a custom list of suggestions and configure basic options like `minChars` and `autoFirst`."},"warnings":[{"fix":"Ensure you are using `v1.1.4` or later to avoid the reverted breaking change. The project documentation does not specify the exact nature of the break.","message":"A breaking change was introduced in `v1.1.3` or `v1.1.4` (exact version unclear from provided data), but was subsequently reverted in `v1.1.4`.","severity":"breaking","affected_versions":"v1.1.3 (briefly)"},{"fix":"For new projects, consider more actively maintained alternatives. If used in existing projects, be aware of potential long-term compatibility or security issues. Thoroughly test with modern browsers and review for any known vulnerabilities.","message":"Awesomplete is largely unmaintained. The last significant update was in 2018 (version 1.1.7). This means it may not receive updates for new browser features, security vulnerabilities, or bug fixes. Community support is also limited.","severity":"gotcha","affected_versions":">=1.1.7"},{"fix":"For CommonJS, use `const Awesomplete = require('awesomplete');`. For ES modules in a bundler, you might need to configure your bundler to handle CommonJS modules or continue to load it as a global script and rely on `window.Awesomplete`.","message":"The library primarily exposes `Awesomplete` as a global variable. In environments using module bundlers (Webpack, Rollup, Parcel), attempting to `import Awesomplete from 'awesomplete'` will not work directly as the package lacks native ES module exports. It only defines a `main` entry for CommonJS.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `@types/awesomplete` separately (`npm install --save-dev @types/awesomplete`). Be prepared to write custom type declarations or cast types (`as any`) for parts of the API not fully covered or accurately reflected.","message":"Awesomplete does not officially ship with TypeScript definitions. While `@types/awesomplete` is available on DefinitelyTyped, it is also somewhat outdated (last updated ~2 years ago) and may not perfectly reflect the runtime API, especially for edge cases or specific event types.","severity":"gotcha","affected_versions":"All versions"},{"fix":"After updating the `list` property of an Awesomplete instance (e.g., `awesomplete.list = newList;`), explicitly call `awesomplete.evaluate();` to force a re-evaluation and redraw of the suggestion list.","message":"When dynamically manipulating the suggestion list while the Awesomplete popup is open, changes may not immediately reflect. The `evaluate()` method must be called to refresh the displayed suggestions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure `awesomplete.js` is included via a `<script>` tag in your HTML *before* any inline scripts that use it. If using `npm`/`yarn`, ensure your bundler correctly processes and exposes it globally, or explicitly `require('awesomplete')` in a CommonJS context.","cause":"The `awesomplete.js` script was not loaded or executed before attempting to use the `Awesomplete` global object, or it was incorrectly imported in a module environment.","error":"ReferenceError: Awesomplete is not defined"},{"fix":"Check the `minChars` option and ensure it's set to an appropriate number (e.g., `1`). Verify that the `data-list` attribute or the `list` JavaScript option contains valid suggestions (e.g., a comma-separated string, array of strings, or a valid CSS selector pointing to a list element).","cause":"The `minChars` option is set too high (default is 2), or the `list` property (either `data-list` HTML attribute or JavaScript `list` option) is empty, incorrectly formatted, or points to a non-existent element/selector.","error":"Autocomplete suggestions do not appear when typing."},{"fix":"Ensure that Awesomplete's CSS and JS are loaded in a way that minimizes global impact (e.g., specific selectors, scoped styles). If conflicts occur, investigate the `Awesomplete.destroy()` method to clean up instances, or consider isolating its usage to specific parts of your application.","cause":"The library creates and manages DOM elements and attaches event listeners, which can sometimes conflict with other client-side libraries, especially given its unmaintained status.","error":"Awesomplete interferes with other scripts or styles."}],"ecosystem":"npm"}