excludeDirs.flat() is not a function
Is your feature request related to a problem? Please describe.
Using the exclude option logs an error excludeDirs.flat is not a function. This is because the .flat method user here only exists from node 11.0.0.
Describe the solution you'd like I'm not sure if other similar newer methods are used elsewhere in the code, but it'd be nice to document the node versions required. Ideally though, it'll be nice to use alternative methods that exist in older versions, or a polyfill. This would make the library more portable
Describe alternatives you've considered
It works without exclude. In my local node_modules/npkill, I added this polyfill from stackoverflow.
A more robust polyfill can be found here.
Additional context Add any other context or screenshots about the feature request here.
Wow you are absolutely right. We launched very quickly to operate the exclude feature but forget to check compatibility precisely (big mistake).
Thank you very much for reporting the error!!
Of course, your PR will be more than welcome if you want to do it!
Got it. What would be preferred: updating the docs to specify the node version required, or adding a polyfill for the .flat method
I think the most interesting thing would be to make npkill as compatible as possible for everyone :) . So a good polyfill would be the most successful.
If you need more information don't hesitate to ask
Closing due to the fact that node11 will no longer be compatible soon