This doesn't match exactly what you think. This splits the whole thing into two different regexes. These are nonsense filenames, but all will match.

     12345-foo.js.backup
     whatever.coffee

What you intended was

    file.match(/^\d+.*\.(js|coffee)$/);

Probably should match the literate versions too

    // Copied the regex from https://github.com/jashkenas/coffee-script/blob/master/src/helpers.coffee#L132
    file.match(/^\d+.*\.(js|((lit)?coffee|coffee\.md))$/);