🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

ext-regex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ext-regex

Regular expression for matching file extensions. Matches single and/or multiple file extensions, like `.min.js`.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ext-regex NPM version

Regular expression for matching file extensions. Matches single and/or multiple file extensions, like .min.js.

Install with npm

npm i ext-regex --save

Usage

var extRegex = require('ext-regex');

'a/b/c.min.js'.match(extRegex());
//=> ['.min.js', '.js', 'js'];

'a/b/c/.gitignore'.match(extRegex());
//=> ['.gitignore', '.gitignore', 'gitignore']

'a/b/c'.match(extRegex());
//=> null

'a/b/c.js'.test(extRegex());
//=> true

Run tests

Install dev dependencies:

node i -d && mocha

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license

This file was generated by verb on January 12, 2015.

Keywords

expression

FAQs

Package last updated on 13 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts