sindresorhus / trash

Move files and directories to the trash
MIT License
2.57k stars 78 forks source link

Only require the necessary os library #109

Closed fregante closed 3 years ago

fregante commented 3 years ago

The Linux lib has 30+ dependencies that should not be required at all on other OSs. I imagine that this unnecessarily slows down other OS.

Perhaps the downside of the current code is that if you use trash as a library, the require code is called at every trash() call. If that's not ideal, I could look into "require once" logic.

Related: https://github.com/sindresorhus/meow/issues/104