Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Improve plugin loader #9

Open
LJNeon opened this issue Jul 11, 2021 · 0 comments
Open

Improve plugin loader #9

LJNeon opened this issue Jul 11, 2021 · 0 comments

Comments

@LJNeon
Copy link

LJNeon commented Jul 11, 2021

  • The fs.readdir call is unnecessary and adds a lot of overhead to what is otherwise a simple synchronous function. For example, exporting a list of plugins via an index.js file in the plugins folder and utilizing that instead would work just as well and reduce overhead massively. Even if that and similar options aren't viable, making the fs.readdir call synchronous would still solve some of the overhead and come with no real downsides considering this is a function meant to be run once as the process starts.
  • The forced console spam as plugins are loaded is less than ideal, even if you added a way to disable it. Removing it altogether and returning an array of loaded plugins instead would work much better, and allow users to implement logging as they wish.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant