Kylart / MalScraper

Scrape everything you can from MyAnimeList.net
MIT License
177 stars 49 forks source link

[QUESTIONS] Refactoring and informations about files #46

Closed JustalK closed 3 years ago

JustalK commented 3 years ago

Hello,

I have seen that in your directory src/search, you have a file name constants.js. I was wondering if this file is exclusively for the directory search or for the whole application ? I am asking that because there are duplicate constants like BASE_URL across multiple files and I was wondering if I can put everything here or I create a new one at the root of the src directory.

Thank you for your answer in advance.

Kylart commented 3 years ago

This file is exclusively used by the src/search folder.

I agree that there is a lot of things that could be removed from core files. I do think that a complete refactoring would be very interesting. It would also include making the library compatible with the browser as well.

For now, I would put the BASE_URL and other constants values into src/utils.js or something alike just like you described.

Thanks for your contributions!

JustalK commented 3 years ago

Ok, I see.

On point thought, can you elaborate on : It would also include making the library compatible with the browser as well I am not sure to completely understand this sentance.

Kylart commented 3 years ago

The idea is that it could be useful for such a library to be usable in the browser direcly instead of a node environment. As of now, I have not tested it but it is really heavy so probably unusable. Also, request is not compatible for the browser to use.

The point remains that a refactoring would be very useful to this library!

JustalK commented 3 years ago

Ok, noted. I will see.

Thank for your answers.