https://github.com/src-d/imports
https://github.com/src-d/imports
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/src-d/imports
- Owner: src-d
- License: apache-2.0
- Created: 2019-11-20T09:54:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-28T15:23:50.000Z (over 5 years ago)
- Last Synced: 2025-05-05T05:05:27.038Z (about 2 months ago)
- Language: Go
- Size: 6.61 MB
- Stars: 7
- Watchers: 7
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Import extraction
CLI for fast import extraction.
## Installation
To build the project from source, run:
```bash
git clone https://github.com/src-d/imports.git
cd imports
go install ./cmd/sourced-imports
```Usage example:
```bash
sourced-imports --root ./project-dir/
```Example output:
```
{"file":"LICENSE","lang":"Text"}
{"file":"README.md","lang":"Markdown"}
{"file":"cmd/sourced-imports/main.go","lang":"Go","imports":["flag","fmt","github.com/src-d/imports","github.com/src-d/imports/languages/all","os"]}
...
```## Using as library
It is possible to use `imports` as a library, but you'll need to add this workaround to your `go.mod`:
```
replace github.com/smacker/go-tree-sitter => github.com/dennwc/go-tree-sitter dev
```This workaround is temporary and won't be required in the future.