-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer programmatic API #41
Comments
Adding my 2 cents here: Quoting knip's README:
Would it also be possible to have a programmatic hook into that graph to use it for other purposes? I'd rather have a single tool build a single dependency graph and use it as source of truth for all my dependency graph needs (whether pruning unused exports or documenting code structure)… |
Here's some additional info:
Not promising anything here, but these are starting points. |
Not in scope, closing this for now. |
To users who think they need a programmatic API, please note that Knip already supports:
(B) and (C) allow to achieve features like:
As of 2023-12-08, they are documented here: https://knip.dev/features/reporters/ |
Thanks @mathieucaroff! A great example is this GitHub Action: https://github.com/marketplace/actions/knip-reporter
A bit off-topic, but I guess it depends on how you look at it:
The initial idea was that it's processing the data before reporting it. But yeah, one can definitely argue it's processing data after it's assembled. |
The
main
function insrc/index.ts
or something similar/new could be exposed for programmatic usage. Yet needs attention in terms of API: what should it look like for external usage?The text was updated successfully, but these errors were encountered: