Explorar el Código

Fonction recuperation extension d'un fichier

Arthur Brandao hace 5 años
padre
commit
d7f3700d69
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/file.js

+ 5 - 0
src/file.js

@@ -71,4 +71,9 @@ module.exports.delete = function (path, verbose = false) {
     }
 };
 
+module.exports.getExtension = function (filename) {
+    const split = filename.split('.');
+    return split[split.length - 1];
+};
+
 module.exports.fs = fs;