https://github.com/pmqueiroz/import-holmes
:shipit: a tool to inspect projects imports. Current supporting javascript/typescript and kotlin
https://github.com/pmqueiroz/import-holmes
ast javascript kotlin traverse typescript
Last synced: 6 months ago
JSON representation
:shipit: a tool to inspect projects imports. Current supporting javascript/typescript and kotlin
- Host: GitHub
- URL: https://github.com/pmqueiroz/import-holmes
- Owner: pmqueiroz
- License: mit
- Created: 2023-03-07T01:12:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T19:06:21.000Z (over 1 year ago)
- Last Synced: 2025-08-23T10:25:00.152Z (11 months ago)
- Topics: ast, javascript, kotlin, traverse, typescript
- Language: Rust
- Homepage:
- Size: 3.95 MB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[peam-url]: https://pmqueiroz.com
[src-url]: https://swc.rs/
[issues-url]: https://github.com/pmqueiroz/import-holmes/issues

**Import Holmes** is a tool to inspect projects imports.
## Languages Supported
- [x] TypeScript
- [x] JavaScript
- [x] Kotlin
> **Warning** this tool isn't in a stable version and can change
at any moment, check [issues][issues-url] page to check futures features and current problems
## Getting Started
### Installing
```sh
brew install pmqueiroz/tap/import-holmes
```
### Cli args
| Options | Default | Meaning | Example |
|---------|:-------:|---------|--|
| `-m`, `--module` | ts/js: `package.json.dependencies` kt: `*`| Filter inspection by module's name | `-m a,b` |
| `-s`, `--specifiers` | - | Filter inspection by specifiers name | `-s Button,Text` |
| `-g`, `--glob` | ts/js: `**/*.{ts,tsx}` kt: `**/*.kt` | Glob to select files to inspect | `-g components/*.{js}` |
| `-o`, `--output` | `table` | Configure the output type | `-o json` `-o csv` |
| `--sort` | `none` | Sort the output by `ocurrences` or `referenced` | `--sort referenced` |
| `--language` | `typescript` | Select which language parser use | `--language kotlin` |
#### Config File
For better configuring you can also set a config file named `.holmesrc.json` following this pattern:
```jsonc
// .holmesrc.json
{
"$schema": "https://raw.githubusercontent.com/pmqueiroz/import-holmes/main/schema.json",
"module": ["some-module"],
"specifiers": ["first", "second"],
"include": ["**/*.{ts,tsx}"],
"exclude": ["node_modules/**", "**/*.{spec,test}.{ts,tsx}", "**/*.d.ts"],
"sortStrategy": "referenced",
"output": "json",
"language": "typescript
}
```
## Demo

Made with :heart: by [**Peam**][peam-url]