Introduction
The path.extname function helps you find the file extension from a file name or path. It makes it easy to know what type of file you are working with.
When you want to check if a file is a .jpg or .png before processing images.
When you need to filter files by their extensions in a folder.
When you want to add special handling for certain file types in your app.
When you want to rename or change file extensions safely.
When you want to validate file uploads by checking their extensions.