StockAlertBot
StockAlertBot copied to clipboard
Update code
Small updates to improve code, fix small bugs, better readability
I browsed the changes briefly but please do me a favor. Could you run npm run prettierAll
and then npm run eslintFixAll
? This will make sure the formatting matches and will make it much easier for me to see the changes.
Thanks!
The current code changes seem to be rewritten for conciseness, no? If there's any bug fixes, can you point out where they are?
From what I've gathered:
-
require
changed toimport
- moved imports and constants to the top
- took out some console statements
- used arrow functions inside
app.get
- changed
undefined
tonull
-
getPage()
revision -
extractInformation()
revision
While I totally agree your changes do make the code easier to read and follow, there are reasons for structuring/writing it the way I did. I wanted to be clear about what the code does and what the program is doing when launched (for debugging and newbie purposes). It didn't make sense to me to import all modules if an environment file is not found. As for import
vs require
, I usually prefer import
but there are good reasons to use require
.
However, I will incorporate some of your changes like using arrow functions inside app.get
, app.listen
being at the end, and perhaps getPage
and extractInformation
function changes once I test them out.