8000 refactor: clean up some code and added comments by uragirii · Pull Request #8 · hkirat/vercel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: clean up some code and added comments #8

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

uragirii
Copy link
@uragirii uragirii commented Feb 11, 2024

Your youtube video is amazing and a great start to a new type of content in Indian Dev Youtube space. Keep doing the good work!
I refactored some of the code and to make it more production ready. I understand that this project is meant for beginners and not for production but still doesn't hurt to improve code a bit ;)
Some changes:

  • Added a README : it is helpful for beginners to read about project before getting into code. Its still a WIP, feel free to add more commands and instructions. Maybe even timestamps for different projects.
  • Moved secrets to env files: A big oopsie. Also added dotenv package to read .env files. Added .env.sample file. If you merge relocated server creds to .env file and added a REDAME.md  #4 I can rebase and remove those changes
  • Cleaned up package.json by moving @types/* packages as dev dependencies
  • Support for more content types: by using mime type package. (Already open by Update index.ts to support multiple file formats #6)
  • Used streams : Refactored code to use streams instead of reading whole files. I understand that reading files are more beginner friendly but we should also teach them how to use stream. (Also you already used streams one place so great!)
  • Added a lot of comments for users to follow the code. Could be useful if you can add timestamps also ;)
  • Added chunkedPromiseAll : to process promises chunk by chunk. This function might be quite advanced for beginners, if you want I can remove it.

If you merge other PRs with similar fixes, I will rebase the code/ remove my changes.

Feel free to push edit to this branch and leave comments. And again, thank you for a new start and keep making videos.

@MohakBajaj
Copy link

@uragirii Thanks for the useful changes. It's gonna help me review the code faster and add more features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0