-
Couldn't load subscription status.
- Fork 3
Description
First of all - great idea! I can definitely see myself integrating something like this in my codebases.
But this got me thinking about modules that are required across many files (e.g. something like request). It's going to be unmanageable repeating secureRequire("awesomeModule", ["dep1", "dep2", ...]) all over the code.
Obvious solution that comes to mind is having a configuration file that will hold whitelists:
{
"awesomeModule": ["dep1", "dep2", ...]
}so you can just go with secureRequire("awesomeModule").
I know this might sound like a stretch, but it the future this might even part of package.json as a vital part of your module's definition:
package.json
{
...
"dependencies": [...],
"security": {
"awesomeModule": ["dep1", "dep2", ...]
}
...
}Or maybe you already have a solution in your mind that addresses this problem?