Using Node.js’s path module, you can get file extensions as follows:
path.extname('index.html')
// returns
'.html'
path.extname('index.coffee.md')
// returns
'.md'
path.extname('index.')
// returns
'.'
path.extname('index')
// returns
''
・Path Node.js v0.10.26 Manual & Documentation
That’s all from the Gemba.