[Feature Request] Make `getCrumbClear(...)` public API
Feature Request
Wanted Feature
Expose getCrumbClear(...) Internal API
Use Cases
Sometimes we want to start from a clean state (just in case, for retry), and to my understanding there is no way to do that with public APIs. So requesting promoting the getCrumbClear() function to public.
Hey, agree. It just might be quite a while until I can get to this, unfortunately. Will happily accept a PR in the meantime otherwise will report back here when I've had a chance to action this.
Better late than never 😅
- [x] Expose
lib/getCrumb - [x] Document the module
So now you'll be able to:
import YahooFinance from "yahoo-finance2";
import { getCrumbClear } from "yahoo-finance2/lib/getCrumb";
const yahooFinance = new YahooFinance();
await getCrumbClear(yahooFinance._opts.cookieJar);
Obviously _opts.cookieJar should still be considered internal and could change in the future, but it hasn't for years.
This will be in the next v3 release. There will be an automated message here once it's published. Although v3 is not yet "official", nor marked with the @latest tag, many are using it succesfully. For more info on upgrading, see UPGRADING.md. Unfortunately, I don't have the capacity to backport fixes or code back to v2.