ext-to-regex
v0.1.0
Published
Create a regex for matching file extensions.
Downloads
278
Maintainers
Readme
ext-to-regex
Create a regex for matching file extensions.
Install
Install with npm:
$ npm install ext-to-regex --save
Usage
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)$/
Related projects
You might also be interested in these projects:
- dotfile-regex: Regular expresson for matching dotfiles. | homepage
- ext-regex: Regular expression for matching file extensions. Matches single and/or multiple file extensions, like
.min.js
. | homepage - filename-regex: Regular expression for matching file names, with or without extension. | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on May 23, 2016.