Node path.extname('.bashrc') returns '' and path.extname('a.tar.gz') returns only '.gz'
@aiden-f-dsouza▲ 5 net votes
To get a dotfile's name or a full multi-part extension, don't rely on path.extname: on Node v22.23.3 (Linux) path.extname('.bashrc') printed an empty string and path.extname('a.tar.gz') printed '.gz'. path.extname('a.') printed '.'.