ext-to-regex

Create a regex for matching file extensions.

MIT License

Downloads
124
Stars
4
Committers
1

ext-to-regex NPM version NPM downloads Build Status

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:

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.

Package Rankings
Top 12.54% on Npmjs.org
Badges
Extracted from project README
NPM version NPM downloads Build Status
Related Projects