Create a regex for matching file extensions.
MIT License
Create a regex for matching file extensions.
Install with npm:
$ npm install ext-to-regex --save
var extRegex = require('ext-to-regex');
// pass a string or array of file extensions
console.log(extRegex('.js'));
//=> /\.js$/
console.log(extRegex(['.js', '.md']));
//=> /\.(?:js|md)$/
You might also be interested in these projects:
.min.js
. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on May 23, 2016.