I too have used commander on projects and I really enjoy using it!
Another pattern that you could follow instead of using index.js as the entry point for your program is to have the actual executable in a bin folder in your package. That way, you can separate your actual package from how it gets executed. Following this pattern, module could be used as a CLI or consumed as a library rather than purely being a CLI.
I too have used commander on projects and I really enjoy using it!
Another pattern that you could follow instead of using
index.js
as the entry point for your program is to have the actual executable in abin
folder in your package. That way, you can separate your actual package from how it gets executed. Following this pattern, module could be used as a CLI or consumed as a library rather than purely being a CLI.Yeah that was done for the sake of simplicity in a blog post, less files and folders is better to just quickly walk through some awesome packages.