wildcard
Very simple wildcard matching, which is designed to provide the same functionality that is found in the eve eventing library.
It works with strings:
wildcard('foo.*', 'foo.bar');
wildcard('foo.*', 'foo');
Arrays:
var testdata = [
'a.b.c',
'a.b',
'a',
'a.b.d'
];
wildcard('a.b.*', testdata);
Objects (matching against keys):
var testdata = {
'a.b.c' : {},
'a.b' : {},
'a' : {},
'a.b.d' : {}
};
wildcard('a.*.c', testdata);
While the library works in Node, if you are are looking for file-based wildcard matching then you should have a look at:
https://github.com/isaacs/node-glob