{"id":48492606,"url":"https://github.com/danisztls/site-search","last_synced_at":"2026-04-07T11:33:56.604Z","repository":{"id":59453054,"uuid":"413167747","full_name":"danisztls/site-search","owner":"danisztls","description":"A standalone instant search component.","archived":false,"fork":false,"pushed_at":"2023-03-04T20:47:03.000Z","size":186,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T15:53:26.608Z","etag":null,"topics":["jamstack","search","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danisztls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-03T18:48:51.000Z","updated_at":"2023-05-12T17:05:30.000Z","dependencies_parsed_at":"2024-06-20T10:22:07.254Z","dependency_job_id":"cdfe4758-f986-4642-a97d-8bc7ee785c47","html_url":"https://github.com/danisztls/site-search","commit_stats":{"total_commits":145,"total_committers":1,"mean_commits":145.0,"dds":0.0,"last_synced_commit":"c10ecd68085f07b18cf07a9feecae801e03c6d54"},"previous_names":["danisztls/lite-search"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/danisztls/site-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisztls%2Fsite-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisztls%2Fsite-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisztls%2Fsite-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisztls%2Fsite-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danisztls","download_url":"https://codeload.github.com/danisztls/site-search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danisztls%2Fsite-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31511763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["jamstack","search","web"],"created_at":"2026-04-07T11:33:56.367Z","updated_at":"2026-04-07T11:33:56.547Z","avatar_url":"https://github.com/danisztls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search\nAn instant search UI Web component aimed to be light, agnostic and effective.\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/b569fb24-1b63-41d4-bec1-df533ecb262a/deploy-status)](https://app.netlify.com/sites/lite-search-example-f99854/deploys)\n\n## Features\n- instant search\n- highlight search term matches\n- show match context\n- easy to install\n- runs locally on the browser\n- not overly complicated\n- does not require any kind of framework or tooling\n- [Fuse.js](https://fusejs.io/) is the sole dependency\n- works when offline *(DocSearch doesn't)*\n- works behind authentication *(DocSearch doesn't)*\n- do not track users *(DocSearch doesn't?)*\n- accessibility *(please fill a report if it doesn't work properly with screen readers)*\n\n## Caveats\n- It does not support context-wise search at headings level as [DocSearch](https://docsearch.algolia.com/) does.\n- Fuse.js is kind of dead.\n\n## Demo\nCheck the [demo](https://lite-search-example-f99854.netlify.app/). It uses Hugo.\n\n## Install\n### NPM\n```shell\nnpm install lite-search\n```\n\n```javascript\nimport Search from 'lite-search'\n\nSearch({...})\n```\n\n### Standalone \nIf you can't or don't want to use NPM you can use the bundled (**lite-search** + **fuse.js**) standalone distributables at `dist/`.\n\n*Note: this repository uses Git LFS and you need to have it installed in your environment to successfully clone it.*\n\n```html\n\u003cscript src=\"./lite-search/dist/search.js\" async\u003e\u003c/script\u003e\n```\n\nWhen the call and the script are enclosed together *(bundled)* they can be loaded asynchronously, otherwise you will have to defer the call until the script is loaded.\n\n```html\n\u003cscript src=\"./lite-search/dist/search.js\" async\u003e\u003c/script\u003e\n\u003cscript defer\u003e\n  Search({...})\n\u003c/script\u003e\n```\n\n## Usage\n### Data\nIt expects JSON data at `/index.json` but this can be changed with `dataPath` option.\n\nExpected keys are `title`, `description`, `url`, `image` *(optional)* and `id` *(optional)*.\n\n```json\n{\n  \"id\": \"3db3e4a737a176646e0c3b8d5f25d392\",\n  \"url\": \"/lorem-ipsum/\",\n  \"title\": \"Lorem Ipsum\"\n}\n, \n{\n  \"id\": \"e62701a89b303de6e24cb577ee9d5614\",\n  \"url\": \"/dolor-sit-amet/\",\n  \"title\": \"Dolor Sit Amet\"\n}\n```\n\n### JS\n```javascript\nSearch({\n  // comment keys that aren't going to be used.\n  keys: [\n    { name: \"title\", weight: 7 },\n    { name: \"description\", weight: 3 },\n    { name: \"content\", weight: 1 }\n  ],\n\n  // optionally provide an alias when key names on JSON differ from what the script expects.\n  aliases: [\n    // { input: \"title\", output: \"description\" },\n    // { input: \"description\", output: \"title\" }\n  ],\n\n  dataPath: \"/index.json\",\n  // dataPath: \"/\" + basePath + lang + \"/index.json\",  // for multilingual \n  formSelector: \"#search-form\",\n  modalSelector: \"#search-modal\",\n  minInputLength: 0,\n  matchStrategy: \"fuzzy\",\n  maxResults: 10,\n  maxContextLength: 250,\n  includeMatches: false,  // NOTE: use 'exact' for matchStrategy\n  showSectionOnTitle: true,\n  modalFullscreen: false\n})\n```\n\n### HTML\n```html\n\u003cform id=\"search-form\" role=\"search\" aria-haspopup=\"listbox\" aria-labelledby=\"search-label\" hidden=\"true\"\u003e\n  \u003clabel id=\"search-label\" class=\"fas fa-search\"\u003e\u003c/label\u003e\n\n  \u003cinput\n    id=\"search-input\"\n    type=\"search\"\n    list=\"search-results\"\n    placeholder=\"Search...\" \n    aria-label=\"Search\"\n    autocomplete=\"off\"\n    spellcheck=\"false\"\n    hidden=\"true\"\n  \u003e\n  \u003c/input\u003e\n\n  \u003cul id=\"search-modal\" role=\"listbox\" hidden=\"true\"\u003e\n  \u003c/ul\u003e\n\u003c/form\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanisztls%2Fsite-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanisztls%2Fsite-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanisztls%2Fsite-search/lists"}