{"id":15287589,"url":"https://github.com/discretetom/vscode-ripgrep-utils","last_synced_at":"2025-04-10T01:07:27.191Z","repository":{"id":207295419,"uuid":"718576421","full_name":"DiscreteTom/vscode-ripgrep-utils","owner":"DiscreteTom","description":"Utils to make it easy to call ripgrep in VSCode's extensions.","archived":false,"fork":false,"pushed_at":"2024-01-08T15:07:46.000Z","size":97,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T01:07:22.408Z","etag":null,"topics":["javascript","nodejs","ripgrep","typescript","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","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/DiscreteTom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-11-14T11:23:03.000Z","updated_at":"2025-01-13T06:01:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"847dc846-bde0-4d8e-82ea-d7f287d66b57","html_url":"https://github.com/DiscreteTom/vscode-ripgrep-utils","commit_stats":null,"previous_names":["discretetom/vscode-ripgrep-utils"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Fvscode-ripgrep-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Fvscode-ripgrep-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Fvscode-ripgrep-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Fvscode-ripgrep-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiscreteTom","download_url":"https://codeload.github.com/DiscreteTom/vscode-ripgrep-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137888,"owners_count":21053775,"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":["javascript","nodejs","ripgrep","typescript","vscode","vscode-extension"],"created_at":"2024-09-30T15:32:20.709Z","updated_at":"2025-04-10T01:07:27.169Z","avatar_url":"https://github.com/DiscreteTom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-ripgrep-utils\n\n[![npm](https://img.shields.io/npm/v/vscode-ripgrep-utils?style=flat-square)](https://www.npmjs.com/package/vscode-ripgrep-utils)\n![coverage](https://img.shields.io/codecov/c/github/DiscreteTom/vscode-ripgrep-utils?style=flat-square)\n![build](https://img.shields.io/github/actions/workflow/status/DiscreteTom/vscode-ripgrep-utils/publish.yml?style=flat-square)\n![license](https://img.shields.io/github/license/DiscreteTom/vscode-ripgrep-utils?style=flat-square)\n\nUtils to make it easy to call [`ripgrep`](https://github.com/BurntSushi/ripgrep) in VSCode's extensions.\n\n## Install\n\n```bash\nyarn add vscode-ripgrep-utils\n```\n\n## Usage\n\nVSCode use `ripgrep` to search files. There is a `rg` binary in VSCode's installation directory, but the location differs on different platforms and different versions. This package provides a `getBinPath` function to get the absolute path of the `rg` binary.\n\n```ts\nimport * as vscode from \"vscode\";\nimport { getBinPath } from \"vscode-ripgrep-utils\";\n\nawait getBinPath(vscode.env.appRoot);\n```\n\nThen you can use the high level `search` function to search files, or the low level `exec`/`execJson` functions to execute `ripgrep` with custom arguments.\n\n```ts\nimport * as vscode from \"vscode\";\nimport { getBinPath, search, exec, execJson } from \"vscode-ripgrep-utils\";\n\nconst bin = await getBinPath(vscode.env.appRoot);\nawait search({ bin, folder: \"./\", regex: \"123\" });\nawait exec(bin, \"--version\");\nawait execJson(bin, \"-e\", \"123\");\n```\n\nEnable debug to see what command is executed.\n\n```ts\nimport { config } from \"vscode-ripgrep-utils\";\n\nconfig.debug = true;\n```\n\n## Credit\n\nThis project is inspired by [Gruntfuggly/todo-tree](https://github.com/Gruntfuggly/todo-tree/tree/a6f60e0ce830c4649ac34fc05e5a1799ec91d151) and [alexlafroscia/ripgrep-js](https://github.com/alexlafroscia/ripgrep-js).\n\n## [CHANGELOG](./CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscretetom%2Fvscode-ripgrep-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscretetom%2Fvscode-ripgrep-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscretetom%2Fvscode-ripgrep-utils/lists"}