Installation npm install file-kind Usage var fileKind = require("file-kind");console.log(fileKind("image/png")); // "image"