how to get extension of a file name in node js code example
Example 1: how to check file extension in node js
var path = require('path');
var ext = path.extname('/Users/Refsnes/demo_path.js');
console.log(ext);
Example 2: node js get file name without extension
filename.split('.').slice(0, -1).join('.')