You can Retrieve a full path to a directory of a certain type within a module using Magento 2.
Using this article, When you need your current module path using programmatic way, You can fetch the current working module path by given code snippets.
Magento\Framework\Module\Dir and Magento\Framework\Module\Dir\Reader class used for getting the full path of Current modules any directory path like i18n, etc, Model, Plugin, Helper, API, view or Controller folder. Continue reading “Magento 2 Get Current Module directory full path programmatically.”