Asked 7 years ago
8 Feb 2017
Views 1208
yogi

yogi posted

how to get file extension in Node JS ?

how to get file extension in Node JS ?
Rasi

Rasi
answered Nov 30 '-1 00:00

Node JS also itself JavaScript so lets find extension of file by JavaScript


var filename="modules.txt";
var d =filename.split("."); 
if(d[1]=='txt'){
  //do something
}
Post Answer