{"id":24487045,"url":"https://github.com/supersonichub1/vanilla-js-typeahead","last_synced_at":"2026-04-17T09:32:48.497Z","repository":{"id":107109104,"uuid":"327758956","full_name":"SuperSonicHub1/vanilla-js-typeahead","owner":"SuperSonicHub1","description":"In less than 20 lines of JS! Spent more time spinning up a Flask server and snatching Google's autocomplete API.","archived":false,"fork":false,"pushed_at":"2021-01-08T02:00:45.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T01:31:18.665Z","etag":null,"topics":["flask","python","python3","typeahead","vanilla-javascript","vanilla-js"],"latest_commit_sha":null,"homepage":"https://ImpressionableHealthySweepsoftware.supersonichub1.repl.co","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperSonicHub1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-08T00:39:16.000Z","updated_at":"2023-04-11T15:34:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"eba261d4-6324-4fcd-b30b-6e45b853fe03","html_url":"https://github.com/SuperSonicHub1/vanilla-js-typeahead","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SuperSonicHub1/vanilla-js-typeahead","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fvanilla-js-typeahead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fvanilla-js-typeahead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fvanilla-js-typeahead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fvanilla-js-typeahead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperSonicHub1","download_url":"https://codeload.github.com/SuperSonicHub1/vanilla-js-typeahead/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperSonicHub1%2Fvanilla-js-typeahead/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31923169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T09:10:15.403Z","status":"ssl_error","status_checked_at":"2026-04-17T09:10:14.455Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python","python3","typeahead","vanilla-javascript","vanilla-js"],"created_at":"2025-01-21T15:32:40.325Z","updated_at":"2026-04-17T09:32:48.481Z","avatar_url":"https://github.com/SuperSonicHub1.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vanilla JS Typeahead\n\nA small example displaying typeahead through the [`\u003cdatalist\u003e`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) element and less than twenty lines of vanilla JavaScript.\n\n```js\nfunction removeAllChildNodes(parent) {\n    while (parent.firstChild) {\n        parent.removeChild(parent.firstChild)\n    }\n}\n\nconst search_box = document.getElementById(\"search-bar\")\nconst datalist = document.getElementById(\"autocomplete\")\n\nasync function handleChange(e) {\n    const query = e.target.value\n    const res = await fetch(`/autocomplete?q=${encodeURIComponent(query)}`)\n    body = await res.json()\n    removeAllChildNodes(datalist)\n    for (const {result, subtext} of body) {\n        const option = new Option(subtext, result)\n        datalist.appendChild(option)\n    }\n}\n\nsearch_box.addEventListener('input', handleChange)\n```\n\n## What?\nI know, right! This is pretty awesome! Simple and clean typeahead without the need for a library like [typeahead.js](https://twitter.github.io/typeahead.js/), as long as you don't need more than two text boxes or images.\n\nThe only downside I currently see is that updating the results can appear slow and/or glitchy at times.\n\nAlso, if you're wondering where I'm getting my autocomplete results from, they're from Google. I request and clean them up on the backend, and then send the results to the frontend.\n\n## Installation\nWith [Poetry](https://python-poetry.org/) installed:\n```bash\n# Clone and cd\npoetry install\npython main.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupersonichub1%2Fvanilla-js-typeahead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupersonichub1%2Fvanilla-js-typeahead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupersonichub1%2Fvanilla-js-typeahead/lists"}