{"_id":"@artie-owlet/amqp-routing-match","_rev":"1-85daca541112ae6423c66f8977861b70","name":"@artie-owlet/amqp-routing-match","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@artie-owlet/amqp-routing-match","version":"1.0.0","description":"Package for matching AMQP routing keys and headers","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","clean":"rm -rf dist/","lint":"eslint --cache --ext .js,.jsx,.ts,.tsx src/ test/","test":"mocha -r ts-node/register/transpile-only test/*.ts","coverage":"nyc npm run test"},"license":"MIT","dependencies":{},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.1","@types/chai":"^4.2.21","@types/mocha":"^8.2.3","@types/node":"^14.17.5","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","chai":"^4.3.4","eslint":"^7.30.0","mocha":"^9.0.2","nyc":"^15.1.0","ts-node":"^10.1.0","typescript":"^4.3.5"},"repository":{"type":"git","url":"git+https://github.com/artie-owlet/amqp-routing-match.git"},"gitHead":"65478c024883b5e5c7c1d9d20f8317e80dc3868b","bugs":{"url":"https://github.com/artie-owlet/amqp-routing-match/issues"},"homepage":"https://github.com/artie-owlet/amqp-routing-match#readme","_id":"@artie-owlet/amqp-routing-match@1.0.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-/sRaFHbUupRxx4PS34xhopyCtAr9fxC6klRQ1sH48ItkOXpUW2FzoWNatl2N7RxS2ep/Lm4RAGi1qRuE3MaNzA==","shasum":"32028b18002a7179ad8d4a62282478af190a009c","tarball":"https://registry.npmjs.org/@artie-owlet/amqp-routing-match/-/amqp-routing-match-1.0.0.tgz","fileCount":12,"unpackedSize":11214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDyOHCRA9TVsSAnZWagAA66QQAKGGAAnzSp1sQ16gK8kC\nkv5MJRCLCKRrCmoqbiIIDuIUrGGWhPcZSZKkH9UwTxE+DseAIRl7kSkC7JdD\n7yEXJms3m1wdIIU3uM73POgDJ/kKmS/DDLvZH+hSIsZdnc1D5bCLVSo21bA0\nAD7d1VVsvpIPDPQiq6UHT8/S9aOPYJt/1y1WJ6c/8yoRAlV8MMKsbrIQnAe3\n7aRXvMA5dabZeoabkTKGrEQXI3wzqqVWixy6I80jm1RgGSm/afvxz0TS13g4\ntvX28Vc7ScEENpiUfqXx5m6Px0PNmuMgukj14jbbHCuvsV63lgbGbbTSlPhm\n+zjHCN6NVw8yUsVXiS2WumiLaBKpnOGLLjxTQDxD8tPHkKwM7ZCRYeST3En3\nkF9pb+52oYKKUhUkFXeISCWkAQu2OnTLG7fsOf+EFA/q1D0iagHI4lOyNQPp\n37yEl+qvyjn9ulPoWhbOZtbz0AsOsSMHU+oRQPXfzrj6N+2DYMcfD+j8e+4n\nOyxMFeqHaYxJxP17dcgbvDwtdsCymyGYUwQ/XeTIQLd/8VNm2AQviCF1Yc64\nKH62qHN9ww7Jpa1wISR7H+ASgNqL/03bMuscPujHlfJolkZ6qxWrW/r9yEsc\nSVpEwQOtPc97NddgDsIgLM2UGIsxd5oN9ozdq3bJKkPfpTUfO5CZ/AM25/8O\nnGEp\r\n=pODn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJtiamL9i8/1prWN+P+b87vXoVhbekKMd3umHkt0PDFwIgfYGReor7OtGa3hRWfWxmGdtzpNdWEjqBNMlVKBEWwP0="}]},"_npmUser":{"name":"artie-owlet","email":"artie-owlet@protonmail.com"},"directories":{},"maintainers":[{"name":"artie-owlet","email":"artie-owlet@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/amqp-routing-match_1.0.0_1628382086893_0.9899643886140326"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-08T00:21:26.811Z","1.0.0":"2021-08-08T00:21:27.060Z","modified":"2022-04-04T15:38:34.643Z"},"maintainers":[{"name":"artie-owlet","email":"artie-owlet@protonmail.com"}],"description":"Package for matching AMQP routing keys and headers","homepage":"https://github.com/artie-owlet/amqp-routing-match#readme","repository":{"type":"git","url":"git+https://github.com/artie-owlet/amqp-routing-match.git"},"bugs":{"url":"https://github.com/artie-owlet/amqp-routing-match/issues"},"license":"MIT","readme":"# amqp-routing-match\n![CI](https://github.com/artie-owlet/amqp-routing-match/actions/workflows/ci.yaml/badge.svg)\n![Coverage](https://github.com/artie-owlet/amqp-routing-match/actions/workflows/coverage.yaml/badge.svg)\n![Lint](https://github.com/artie-owlet/amqp-routing-match/actions/workflows/lint.yaml/badge.svg)\n\n---\n\n## Install\n\n```bash\nnpm install @artie-owlet/amqp-routing-match\n```\n\n## Usage\n\n### topic\n\n```javascript\nimport { TopicPattern } from '@artie-owlet/amqp-routing-match';\n\nconst serviceV1 = new TopicPattern('service.v1.*');\nif (serviceV1.match('service.v1.log')) {\n    // do smth\n}\n\nconst serviceAll = new TopicPattern('service.#');\nif (serviceAll.match('service.v1.log')) {\n    // do smth\n}\n```\n\n### headers\n\n```javascript\nimport { HeadersPattern } from '@artie-owlet/amqp-routing-match';\n\nconst test1 = new HeadersPattern({\n    'x-match': 'all',\n    app: 'test',\n    version: 1,\n});\n\nif (test1.match({\n    app: 'test',\n    version: 1,\n})) {\n    // do smth\n}\n\nconst errorOrBeta = new HeadersPattern({\n    'x-match': 'any',\n    log: 'error',\n    scope: 'beta',\n});\n\nif (errorOrBeta.match({\n    log: 'error',\n    scope: 'release',\n})) {\n    // do smth\n}\n\nif (errorOrBeta.match({\n    log: 'debug',\n    scope: 'beta',\n})) {\n    // do smth\n}\n```\n","readmeFilename":"README.md"}