A file suffix is a substring of basename after the first dot.
$ npm install --save file-suffix
const suffix = require('file-suffix');
suffix('./lib/file.js'); // ➜ js
suffix('index.html'); // ➜ html
suffix('build.tar.gz'); // ➜ tar.gz
MIT © Andrew Abramov