This has always been the plan; file-system and even database storage. The slightly more time consuming challenge is the initial cookie code was all programmed as synchronous calls, so it requires a little more work to change the whole flow to work asynchronously.
Leaving this open for now but anyone else is welcome to take a look too. Since we use https://www.npmjs.com/package/tough-cookie internally, we should just support any of their async cookie stores. However, we may need some async bridge code to ensure everything is set up correctly and in the correct order.
As pointed out by @z3nful in https://github.com/gadicc/node-yahoo-finance2/pull/667#issuecomment-1716757932, we really shouldn't need to fetch a new cookie on every new startup. This is especially an issue for serverless functions which are short-lived.
This has always been the plan; file-system and even database storage. The slightly more time consuming challenge is the initial cookie code was all programmed as synchronous calls, so it requires a little more work to change the whole flow to work asynchronously.
Leaving this open for now but anyone else is welcome to take a look too. Since we use https://www.npmjs.com/package/tough-cookie internally, we should just support any of their async cookie stores. However, we may need some async bridge code to ensure everything is set up correctly and in the correct order.
Bad gadicc! This should have all been in a separate branch / pull request, not separate commits. My apologies :sweat_smile: