DEV Community

Discussion on: Detect extension in a directory using node js

Collapse
 
jalal246 profile image
Jalal 🚀

Thanks, David!

Agreed. Using built-in methods are always better than reinventing the wheel. But, we still need to read project entry assuming it's index without knowing the extension. Is It .ts or .js?

These built-ins, helpful when knowing the full name with the extension included file.js. However, I tried to introduce a method to extract an anonymous extension.