namespace-matcher

Namespace string matcher.

namespace-matcher

namespace-matcher is a simply module for namespace match.

Install & Usage

npm i --save namespace-matcher

Then import and use it.

import namespace from 'namespace-matcher'; // ES6

namespace('a.b.c').match('a.b.*') // true
namespace('a.b.*').match('a.b.c') // true
namespace('a.b').match('a.b.*')   // false

// also you can set up your own option
namespace('a-*', {
  sep: '-' // separator
}).match('a-b') // true

namespace('a.$', {
  wil: '$' // wildcard character
}).match('a.b') // true

License

ISC@hustcc.

HomePage

https://github.com/hustcc/namespace-matcher#readme

Repository

git+https://github.com/hustcc/namespace-matcher.git