Wildcard matching tools

npm install wildcard
3 downloads in the last day
8 downloads in the last week


Very simple wildcard matching, which is designed to provide the same functionality that is found in the eve eventing library.

Build Status

It works with strings:

wildcard('foo.*', 'foo.bar'); // true
wildcard('foo.*', 'foo'); // true


var testdata = [

wildcard('a.b.*', testdata); // ['a.b.c', 'a.b', 'a.b.d']

Objects (matching against keys):

var testdata = {
    'a.b.c' : {},
    'a.b'   : {},
    'a'     : {},
    'a.b.d' : {}

wildcard('a.*.c', testdata); // { 'a.b.c': {} }

While the library works in Node, if you are are looking for file-based wildcard matching then you should have a look at:


npm loves you