npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

ext-to-regex

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:10
$ npm install ext-to-regex
DailyWeeklyMonthlyYearly

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:

  • 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

  • github/jonschlinkert
  • twitter/jonschlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on May 23, 2016.