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
Add an option to clear the cache #755
Comments
I went through out the same issue and manged to clear the cache after extracting the dependencies If there is a good reason to keep the cache please let me know so I can go with option 2 otherwise I prefer to apply option 1 |
What cache are you mentioning exactly? The Sounds acceptable to flush it after completion. It's an important piece of optimization, made depcheck multiple time faster on large codebases. |
I used the word cache because I assume depcheck has a system for caching file contents, but I hadn't looked at the source code. I would like to be able to call depcheck several times on the same file whose contents change between calls. Here's a suggestion for emptying the contents of
|
Looks good but as a matter of simplicity, I don't think we need the option and can simply clear it at the end. The cache is not here for an hypothetical second run, it's here because we need to access the files several time in the same run. |
Feature request description
I want to use depcheck in a project. In the tests, I use
mock-fs
to mock files and test the integration of depcheck. But it's always the first values that are used by depcheck.There should be an option to clear the cache.
Code snippets (if applicable)
package.json:
index.js
Any extra info
The text was updated successfully, but these errors were encountered: