how to get the extension of filenames when whole file name is given in nodejs code example
Example: exclude extension from filename javascript
const file = 'test.jpg';
const filename = file.split('.').slice(0, -1).join('.');
const file = 'test.jpg';
const filename = file.split('.').slice(0, -1).join('.');