Socket
Socket
Sign inDemoInstall

regexemitter

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    regexemitter

a regex eventemitter wirtten in javascript


Version published
Weekly downloads
62
decreased by-25.3%
Maintainers
1
Install size
10.7 kB
Created
Weekly downloads
 

Readme

Source

Regex event emitter

An event emitter which takes regular expressions for event names

Install

npm install regexemitter --save

NPM

Example Script

/** regexeventemitter behaves just like nodejs native emitter except it takes regular expressions **/

var EventEmitter = require('regexemitter');
var events = new EventEmitter();

// register a new event
events.on( /send this message to (john|dave)/, function ( arg1, arg2 ){

  console.log( 'event: ' + this.event );
  console.log( 'message:', arg1, arg2 );

});

events.emit( 'send this message to john', 'hello', 'john' );
events.emit( 'send this message to andy', 'hi', 'andy' );
events.emit( 'send this message to dave', 'ahoy', 'dave' );

Output

event: send this message to john
message: hello john

event: send this message to dave
message: ahoy dave

Build Status

Build Status

FAQs

Last updated on 19 Jul 2013

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc