is-code

Check if a filename looks like something pygments can parse

npm install is-code
3 downloads in the last day
33 downloads in the last week
111 downloads in the last month

is-code

Check if a given path looks like code (that can be parsed by pygments).

API

isCode(path)

var isCode = require('is-code');

var lang = isCode('path/to/Makefile');

{ names: [ 'make', 'makefile', 'mf', 'bsdmake' ],
  regexps:
   [ /^.+\.mak$/,
     /^Makefile$/,
     /^makefile$/,
     /^Makefile\..+$/,
     /^GNUmakefile$/ ] }

License

MIT

npm loves you