Asked 12 days ago
8 Feb 2017
Views 257
yogi

yogi posted

how to get file extension in Node JS ?

how to get file extension in Node JS ?
Rasi

Rasi
answered Feb 20 '18 20:17

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
}
Edit Answer
Share
Post Answer