package
Computes the longest (compound) extension that is common to each path
npm install common-extnameGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Computes the longest (compound) extension that is common to each path. Tested with Node.js 0.10 and above.
npm install --save common-extnameThe module has one default export, the commonExtname function:
var commonExtname = require('common-extname')Call commonExtname() with an array of paths (strings):
var paths = ['main.html.handlebars', '_partial.html.handlebars']
commonExtname(paths) // returns '.html.handlebars'An empty string is returned if no common extname exists:
commonExtname(['index.js', 'package.json']) // returns ''