amqp-match

simple library for matching amqp routing tokens, with *'s and #'s

Usage no npm install needed!

<script type="module">
  import amqpMatch from 'https://cdn.skypack.dev/amqp-match';
</script>

README

amqp-match

transforms amqp routing keys to regular expressions for more convenient runtime matching

  amqp-match
    ✓ should match this.key to this.key (direct equality)
    ✓ should match this.new.key to this.*.key (single word wildcard)
    ✓ should not match this.new.other.key to this.*.key (single word wildcard)
    ✓ should match this.new.kinda.key to this.#.key (multi word wildcard)
    ✓ should not match some.new.kinda.key to this.#.key (single word wildcard)