File Ext Extract the file extension from a path. Install npm install file-ext Usage const fileExt = require("file-ext"); fileExt("a/b.txt"); //=> 'txt' API fileExt(filename) filename Type: string The filename to extract the extension from.