Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
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.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

ext-regex NPM version

Regular expression for matching file extensions.

Install with npm

npm i ext-regex --save

Usage

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

var ext = regex().exec('a/b/c.js');
//=> ['.js', 'js'];

Multiple extensions

By default, only the last extension is matched, e.g:

var ext = regex().exec('a/b/c.min.js');
//=> ['.js', 'js'];

Pass true to get multiple extensions:

var ext = regex(true).exec('a/b/c.min.js');
//=> ['.min.js', 'min.js'];

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) 2014 Jon Schlinkert
Released under the MIT license

This file was generated by verb on December 29, 2014.

Keywords

expression

FAQs

Package last updated on 30 Dec 2014

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