{"id":16371365,"url":"https://github.com/mateonunez/lyra-impact","last_synced_at":"2025-03-21T01:31:33.634Z","repository":{"id":58789710,"uuid":"527205090","full_name":"mateonunez/lyra-impact","owner":"mateonunez","description":"Create a Lyra database from anywhere. Full REST API supported, GraphQL and CSVs.","archived":false,"fork":false,"pushed_at":"2023-06-13T17:04:41.000Z","size":172,"stargazers_count":9,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-17T12:06:39.918Z","etag":null,"topics":["database","filesystem","graphql","impact","lyra","plugin","rest"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mateonunez/lyra-impact","language":"TypeScript","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/mateonunez.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":"2022-08-21T12:49:47.000Z","updated_at":"2023-09-26T03:25:32.000Z","dependencies_parsed_at":"2024-10-28T09:13:00.665Z","dependency_job_id":"df68f2b9-7292-4081-983d-a881e1f2da3e","html_url":"https://github.com/mateonunez/lyra-impact","commit_stats":{"total_commits":239,"total_committers":2,"mean_commits":119.5,"dds":0.004184100418409997,"last_synced_commit":"1a33b80ace72f5c1819a60eec480f749f3a6f3e6"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateonunez%2Flyra-impact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateonunez%2Flyra-impact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateonunez%2Flyra-impact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateonunez%2Flyra-impact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateonunez","download_url":"https://codeload.github.com/mateonunez/lyra-impact/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244721200,"owners_count":20498904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","filesystem","graphql","impact","lyra","plugin","rest"],"created_at":"2024-10-11T03:07:48.832Z","updated_at":"2025-03-21T01:31:33.265Z","avatar_url":"https://github.com/mateonunez.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌍☄️️ Impact \n\nCreate a [Lyra](https://github.com/lyrasearch/lyra) database from anywhere.\n\n[![Tests](https://github.com/mateonunez/lyra-impact/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mateonunez/lyra-impact/actions/workflows/ci.yml)\n\n## Installation\n\nYou can install Lyra using `npm`, `yarn`, `pnpm`:\n\n```sh\nnpm i @mateonunez/lyra-impact\n```\n```sh\nyarn add @mateonunez/lyra-impact\n```\n```sh\npnpm add @mateonunez/lyra-impact\n```\n\n## Examples\n\nSee the full list of examples: [mateonunez/lyra-impact-examples](https://github.com/mateonunez/lyra-impact-examples)\n\n- [React](https://lyra-impact-examples-with-react.vercel.app/)\n- [Vue](https://lyra-impact-examples-with-vue.vercel.app/)\n- [Supercharged](https://lyra-impact-supercharged.vercel.app/)\n\n## Usage\n\n```js\nimport { search } from \"@lyrasearch/lyra\"\nimport { impact } from \"@mateonunez/lyra-impact\"\n\n(async () =\u003e {\n  const lyra = await impact(\"https://raw.githubusercontent.com/LyraSearch/lyra/main/examples/with-vue/public/pokedex.json\")\n\n  const { hits } = await search(lyra, { term: \"pikachu\" })\n\n  console.log(hits)\n})();\n```\n\n**Result**\n```js\n[\n  {\n    num: '025',\n    name: 'Pikachu',\n    img: 'http://www.serebii.net/pokemongo/pokemon/025.png',\n    type: [ 'Electric' ],\n    height: '0.41 m',\n    weight: '6.0 kg',\n    candy: 'Pikachu Candy',\n    candy_count: 50,\n    egg: '2 km',\n    spawn_chance: 0.21,\n    avg_spawns: 21,\n    spawn_time: '04:00',\n    multipliers: [ 2.34 ],\n    weaknesses: [ 'Ground' ],\n    next_evolution: [ { num: '026', name: 'Raichu' } ]\n  }\n];\n```\n\n## Formats and fetchers\n\n`lyra-impact` supports the following formats and fetchers:\n\n| Format            | Fetcher               | Description                                     |\n| ----------------- | --------------------- | ----------------------------------------------- |\n| `JSON`            | `fetch`, `filesystem` | Fetches a **JSON** response or file             |\n| `GraphQL`         | `graphql`             | Fetches a **GraphQL** endpoint                  |\n| `CSV`             | `fetch`, `filesystem` | Fetches a **CSV** file from a URL or filesystem |\n| `XML` (_REMOVED_) | `fetch`, `filesystem` | Fetches a **XML** file from a URL or filesystem |\n\n### With GraphQL\n\n```js\nimport { search } from \"@lyrasearch/lyra\"\nimport { impact } from \"@mateonunez/lyra-impact\"\n\n(async () =\u003e {\n  const lyra = await impact(\"https://rickandmortyapi.com/graphql\", {\n    fetch: {\n      fetcher: \"graphql\",\n      query: `{\n        characters {\n          results {\n            type\n            status\n            species\n            name\n            id\n            gender\n          }\n        }\n      }`,\n      property: \"characters.results\"\n    }\n  })\n\n  const { hits } = await search(lyra, {\n    term: \"Morty\"\n  })\n\n  console.log(hits)\n})()\n```\n\n### With Filesystem\n\n```js\nimport { search } from \"@lyrasearch/lyra\"\nimport { impact } from \"@mateonunez/lyra-impact\"\n\n(async () =\u003e {\n  const lyra = await impact(\"./data/examples/characters.csv\", {\n    fetch: {\n      fetcher: \"filesystem\"\n    }\n  })\n\n  const { hits } = await search(lyra, {\n    term: \"Morty\"\n  })\n\n  console.log(hits)\n})()\n```\n\n### Collision\n\n`collision` method allows you to fetch and search a **term** in the API results.\n\n- `url: string`\n- `searchOptions: SearchOptions`\n- `impactOptions: ImpactOptions`\n\n```js\nimport { collision } from \"@mateonunez/lyra-impact\"\n\n(async () =\u003e {\n  const { hits } = await collision(\"https://raw.githubusercontent.com/LyraSearch/lyra/main/examples/with-vue/public/pokedex.json\", { \n    term: \"pikachu\" \n  })\n\n  console.log(hits)\n})();\n```\n\n**Result**\n```js\n[\n  {\n    num: '025',\n    name: 'Pikachu',\n    img: 'http://www.serebii.net/pokemongo/pokemon/025.png',\n    type: [ 'Electric' ],\n    height: '0.41 m',\n    weight: '6.0 kg',\n    candy: 'Pikachu Candy',\n    candy_count: 50,\n    egg: '2 km',\n    spawn_chance: 0.21,\n    avg_spawns: 21,\n    spawn_time: '04:00',\n    multipliers: [ 2.34 ],\n    weaknesses: [ 'Ground' ],\n    next_evolution: [ { num: '026', name: 'Raichu' } ]\n  }\n];\n\n```\n\n# License\n\n[MIT](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateonunez%2Flyra-impact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateonunez%2Flyra-impact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateonunez%2Flyra-impact/lists"}