9951 explained code solutions for 126 technologies


nodejsHow to get file extension


const path = require('path');
let ext = path.extname('image.png');ctrl + c
require('path')

module to work with file/dir path

.extname(

returns extension of a given path string

image.png

sample file path to get extension from