{"_id":"pg-listen","_rev":"22-489d52f41fe2f0fe4445ed389f635ab8","name":"pg-listen","dist-tags":{"latest":"1.7.0","experimental":"1.0.0-with-cjs-hack","test":"1.3.2-connected"},"versions":{"0.1.0":{"name":"pg-listen","version":"0.1.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDepedencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"d02bc395146fd62fae49cf72e16f5b839ec60249","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-VJQITZnH5vBseAR7dJ8LkBwStv7qdEj2On7uzmvWghEqkrkaNaq71Ht/GAcxyqK9Tly/IynkWL9f7mXiLH8NFw==","shasum":"6b65dab195264b661659e7e41c310a4db485072d","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-0.1.0.tgz","fileCount":10,"unpackedSize":19507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbr8VuCRA9TVsSAnZWagAAhu4P/iobZTYG5YGmheWKE9VN\nP7gBJuZSEGEsxHG3UlBfxSSz0SI+cqEsXjG4WSd2GF01Pi7Wz1xXQnRpNcsE\nzKLr7q7x96EZDU3zcMy3KO7eDl5XB81eJc13t58cP1jkQ+tLpzE45jsvqRWt\nUjZsAI4mqMUq3wqVXt7/NaRUQrPOS9Ewi15FIHrVJDLlM/ELrCpkJXv3a/OL\ne32DsemLOUE6RAZOXSme9sWCAFrtKZuGBUrfAIY5voRf+MxTEadS/vFkvXMq\nKlyW/Hd2LMPmgP8s/tgzrYQjgToMgHF4GJ/jV9ALD+QYNaQvqlRZkXd0Lkcb\nJv844d/PylGBFusP/ZNh6NMeihzT++f61QXoTAHfgpxIJtKZTS+Ud2g4rjaw\n5dd8QvXLBHtW2ATDaB8g1jAWMkocZQvANf5MZXaSdVmG1vOa0k/wp4MVo2wh\nyBOl3RrGGvWPeKJ3CURNiqgyfxfhQmPlYY1xnlIgTjxqvx+S2Uz4XoREHUMC\nj7LlHHtW8C0VEoBN+i7C2XEl2rHlMOX1LX7eVbl+DDyJ7NpXYbfGagXtVd0v\nUGWd3wh6GeDFV01e8DiM4AwcPDc9Xqse3Vr8jJ1Yb6Q5C52thwdmrK0TWEZD\nNJBvuuVkkhM+i/q6v5wqiQLd/aaFnq26qOeLq4uqq/zY/Z5TeonAhR12hYtA\nual7\r\n=6ntX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJj9QnrBkB9P7FQEjKppXDBNy8ci9KNa7/IEw6m01NlAiEAu1j9ZGsoPQmGTE6Xm7p0ijMk+r+qbdwwdkiUsoGBW14="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_0.1.0_1538245998016_0.2087380069160496"},"_hasShrinkwrap":false},"0.1.1":{"name":"pg-listen","version":"0.1.1","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"60d3053b586c71c4709d3024d24cb896dc5ceb13","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-M5ZuhFPi8CskDedKVl4b/fUuh6t3VC+N7fLA2ctzBt3lWB7MTh4uCyBMgfQrQhEDJpi73bkly6wvTqEnZZnt4w==","shasum":"75df10ec004b697035d336c1b5b2b12506d2f49e","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-0.1.1.tgz","fileCount":10,"unpackedSize":19587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbr8cNCRA9TVsSAnZWagAAObAP/2E/IZy2NQqgGkKOaWJr\n16IwSCzku6U0zwS1v2CkojyuhFV80KVDjZPJrOpmCYbbOMj0Rtu0H23NAif6\neQ/afZ+CRa1ib4WrTIwCDnSZCahYi1XHFmQsEIhJZb7SCjvJf9NM9LCg2BV6\nPQ8wnNaQGZHXNvvVWlgii0+Yg5SXdC7Dq/mKBp2J8/SeNCWSNZnGz2QlBbRh\ne+QkrUNDV91BItIhKnkA3YkehtSKCY3NShZxXexS9zGg907USww8YDUoefrj\n9pDpB0ej481OQ0+c3L30lwE9M5DKkGvzlkWv63HxUPV4DH31VSC3Iz9rweFo\nM/AqMSZhIhNAZrqjZ7/umekZYi93Ca0dZxAKM5Yam5OIewZDOF0O0gsEbhhk\n/fTOftbBNYuPiRjhEwb3HNNulQmUxqxj8kcjgIZnoonlAZpWRz8OLx+hapLA\ntm/YSNptD+JxFzCQyOXk44ljky1fO5sfvXCKs1j/KRny3RPpSuoGdkenSWUk\nM/FAAjnA/WUEGnu5HA4ab2bwTcMBHVbmSorAuhIuHczdikuVQudaTKZUpe65\nQSq/Ah7FGm8d++cJdIY5IOEWu53ixJdk7/H974Rq9YhYhR1ILAZ9exaDax0B\nUuQhDoNEqqlkGeKgu0j9yEXtfyv9RXTmDJ+DQRMbzGpCzFbE4qCGbn6QDMgH\nHmnz\r\n=sla3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH3fChdGt9IJNioYNh0gA7//Pez9STckDpsou+UgtFrwCICG37DelPQS6ET+yQof8woLN4ITkzHIrpQZAERr4oPeN"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_0.1.1_1538246412788_0.7468921727446975"},"_hasShrinkwrap":false},"0.1.2":{"name":"pg-listen","version":"0.1.2","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"7af512e3af9b3b9c979d74edaf49e17351d986c5","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@0.1.2","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-/s5SLmskGczlQvUUQiHGWQcpxjVgvJ89GtpQActYNo69jhzQlXA8+6KQ8Uh6SQKJvrAeQm++wTWjYWRe2NdmYw==","shasum":"f72c2717eab52a436d7c2c1cefebe1de2b354ebe","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-0.1.2.tgz","fileCount":7,"unpackedSize":23085,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsmZdCRA9TVsSAnZWagAAi5AP/0vp0MoSQW95jpbKc3xp\njC3IYdKhNC67ggO4sJMg95I0SOyUX1A3ptO8Hv9ibw3eQ+DSth5n1QhCaqti\noK8NExSKyMGAL8SG2JW4p4cRTItae0HG9aXk/qrLxlE5I1d/H2AJyjnmQ2S1\nQyr9vdXFEZSfHueA4Gn57WAg0MHiofuOjd+aHpKrqtKyCjtanP0dhoPRzp59\n8RZjNblW1Q8q2HinYWovcFYJwKHMNLbrAEYYNPu51hsznYmBcru4wSC8W90S\npy5824T3id+e8JVa3JWkDBr0J19ajzNPepKBOscj2exgPhhPwI2y6HT9dBo/\n6FZmnu/C4j3uuhKsfMHSyFhzqq6yPpA0RypJWIx3LeMh/PkoWbQELVAT7WA/\ndhVaQpJYjCynn7sbZaP4hkFsYxmp/+3IHe8vRV8IXtDMoOQj6jIbCuvrdrcz\n6TRudlv5pX8tAgxXMLzfMrW81pn/xpl1KMjWpeAzbfN8QpuLxB6z+peh4Uvh\nGUlfY7x6flLRcHDxOoSipGLy5x1MZ89HiDZ8HmTDhwp7dC0jPmV+EaMrRqXo\nflVHbxyMeOgSNj9FWtylo31U0v3TGKGSi2oiWpT40c1oNL1SQ9OgszzO9iGY\nsRivngEtzt9B0CH5KGahlAenapSV2USZLl7NTlLljHXu2TL5iYtYBxK6CdjP\nQFVZ\r\n=yHwD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSLcZLHlcsx3/g8/UBE14ZU2jB3KCLVbHPeeaX3C7DoAIhALBXMBRyWmBx71AdTYDcZf9pIbyWcdnaewAkEsSK+8WF"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_0.1.2_1538418268927_0.42546137251365423"},"_hasShrinkwrap":false},"0.1.3":{"name":"pg-listen","version":"0.1.3","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"1e9b3c28886ce6a905d2607c537fc73823cc0bbe","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@0.1.3","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-bCyQZvaF9YF41xBG8oHKXBkIpEKTyylg0nS5Q6FjNaebAKG9aDnTeNg4Wk/tk2F/6eq5JsGnYlv7oqI2v9O1kg==","shasum":"561415640e384b9d9d60b0f8d247e86db0bfc80e","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-0.1.3.tgz","fileCount":7,"unpackedSize":23123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxkxvCRA9TVsSAnZWagAA4t4P/1Q8dD/oVb/xoafKzn9v\nXel2vrkm+pkI0MWfrT8iia9q5RAbxOFXkakNBBYJ8xZ6gmp/lGf4Aq+bnDK8\n1i3fgfoSJ0F7Op6QeQW6B7oKezCKQyT67iTiH9d626wVHHkBZ+MzLW6A2pOJ\npWxmR+GdHMBI/If7HWLkif/SO94DqVl2PfWdIFjBR/13nerH8mjjAfhBHFsq\n/59/zQ4S5Kzt0Bqf/iPxMaLWrDSruoGy3Rq9TSCFfA2AeOGYCjFwCCK5SfRA\nIkjlIUtqwKHoqU0ShLUnoFcaPIMPac7p9+Fnb38CO9QPk3byHpar4ETjleql\nzz2V9ZICxE7jnJcU2MMl6D4xRBtKWbiPnFTU1FxpUbbcotpzz0oZv2m+NzYr\nf7DX1Qmb/wwTsIZryxVbXoanrxyPSdr0mglu+2a1QZ80NqqYFDlFmsWVOBMe\ngLZYkMcDQtEPgppj0v7w5YS/xIDEHyONpb0UntwNOoqts0XolGfbrZsYWIpF\nfaLn+3DYQj7SefRU9UamHlQ87sx/es5CIa6lnpXI7DUp1VF0JAcCKd1Pbyrm\nHMjM//a5RcAwSHnhQj/X3cyiCYafRTgjANNU6nFqhuWHn0IAKkoR6cIOoV96\nUDY9OJ9Ja4yRqok2uMGOllMNJ4a9R1/t41jo/LA/EuQYC0IkAwka//Zf20Mq\nfsEv\r\n=IGfM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI2iBHEliYt+sHAk+8GAPK1ug3Z4bAl/o07DUXhlA3UgIhAP7QrzBgooBLOx+FCB0fryY201z3a7ZXZMdWYB1Lq01f"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_0.1.3_1539722350082_0.8640343963216115"},"_hasShrinkwrap":false},"0.1.4":{"name":"pg-listen","version":"0.1.4","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"849892c1d3a8cb46df776ab51d4a98eb262cbccc","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@0.1.4","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-5yaQsU3li26PeYz87IftLO6EpvhZ0Up0HUrlEADPeqFQjclCtc2FzVS9h368ltVKYn5IU5oUwbVOSxEeVpx9WQ==","shasum":"026c5bffd6e7083bd8ebff9e69669fb956d6b0c3","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-0.1.4.tgz","fileCount":7,"unpackedSize":23119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4KZECRA9TVsSAnZWagAA3BMP+gN/GHJu9L8xPMlNAAfi\ndENAGp2hq3D7qIl4E9LNqJr0hudZzGguJLr+/s6sWOgPTAfQmXr6TLi17WBh\nBGP9b1L/x/1tZRh2H+wRR7enremolsMTyqS5G7ckPMmJNWXTOSkZYsGuscQO\nZ5WKxMtnmuHudTGFeTvHCUqCfZFFXddOQjxG4/J1EtDaAFl/ezwUp4Hrzp4e\nnM0G+TQbLLX8iTkiffiJdXbzVVYBKyu/WVyqG9rFYzt5Q8kpHmo7zzGXDErU\nqoFIdPDV//c6eFPa/PNopj/Pm6X/MWxmpDRpfcAnDz+DcsIzl/lbQh1OaEkQ\nDpuTMnTmZLN8DJWlgqDOFloCDthB0FcjWDzgYhkwjDAfAevx4lHTcYU/5uHA\nC3UNv+UVYA2cJchOyRFlpX4bHElRzPg1dUE2qpP023U8IO933pmm52vi0/5m\np8g+sIITf1jqpByg0lReIuOxi43BUD7bspVPPHuVerKRDFuN1541ruQq6vng\nE47J92BZTCokZazqn3G4GNImOqwn3wj3ZJFnHKrgfQyhCicYngXMtaSIL10t\nj/KnESFYh63WPElQcepRZyQD/vhT3x1Mz4pd+9yus5p+lJD9fRMXiA4G+Jr2\nFvRnG+1cI/PJKLcQ3ooT3vOOidu9xNG0JuV617zX4KVO5T17qf2lWOinbOzu\nEeMl\r\n=lefe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAppP6CnHHmqcP3uyiBuoVtrEqdQK4SLXND6mQvQWUfSAiBxI15m6PztdR3Edl5sG3KKgJT2WdkFdXzP3sBGMeczDA=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_0.1.4_1541449283877_0.43499332865378215"},"_hasShrinkwrap":false},"1.0.0":{"name":"pg-listen","version":"1.0.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./dist/index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"002690486dcdee3462dadbe2dcf024f869f676e9","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.0.0","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-Uoxsn1ro3Eh2Ki5Zx7mLTw767KqySPhqSQYfcjTe2tdNzz65eWANn3qXNQiJZTiMW+Y8eUjg2C32WTeYrNUnlQ==","shasum":"6c637ddb673ba7e94f6fe6590e1c349ce5ef08ca","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.0.0.tgz","fileCount":7,"unpackedSize":23508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcO0JcCRA9TVsSAnZWagAAZewP/As09eBsBNC7phnnKUu8\nDjd9EgqpuIIfqWEz2Hm+y6K6ZxtajCnEJ+nknCqAn1BcKsj+YvqhyHET41EL\nN/1QluPWKYHZCx1s8hPwuOZer+d1lD/KNn9yoYGxYc1Y0XvgmMn/Ki3G3R0n\nKSlDqCJWD30ntSs5q0nh/pQi0UxVmhHZlv32WBO510TmpiEYxlf8rM52T7vu\nB/SQFYtpDJz8/y35g5GEu1u3Id/wZ7CvdMB71ORExdO8wb5xyyNSFJw+2WYE\n2wcCPqeNCkD5SDVv95pGRDkZl72S15uaAnN9KoqMBbeOC43uXgj6OY7MfKi0\nULetgLft7osss/hm12m2H1g2LW1edXeAAWn4s6yh51N0lsrVOnhLNr3ZQsSE\nHFf3ly7+qPrFMqQo78P4vcsC/3xkAt+tt6gEjIbJd+LNnh/BbtV+AF3SUxNT\n66TJlZYZwUxbMG95wBbUbsPZBnARRbfwwSkcE5wR4O3jhnEDxwX4Wy5EfuNz\n/PFGSCKWC347+0IFqTSnV8p6R9FQZLAsPwTS/B0EiCGzFX3T5IUzaGuoZqqq\n0x8xRSKv/qNyWbejXLRN1CkFXbIPN48toP8wXHFpVbC8D3Hm/m4rJ8A34XY4\nWFwYQVdSno61QCG/ryG24tZv4rXeaBf19c/n2Y1r9T4Bc49ngVMNw89snAAb\nJ+eW\r\n=wIDp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAWffdyBKXBBI525jhoANaWrNJB6rP7PV92RHt4DzUJAIhALYJGpQvuX40kLarMxqOLod1t70fRN78WMV2IRSStydi"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.0.0_1547387484209_0.25244134496553805"},"_hasShrinkwrap":false},"1.0.0-with-cjs-hack":{"name":"pg-listen","version":"1.0.0-with-cjs-hack","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"readme":"# pg-listen - Postgres LISTEN & NOTIFY that works\n\n[![Build Status](https://travis-ci.org/andywer/pg-listen.svg?branch=master)](https://travis-ci.org/andywer/pg-listen) [![NPM Version](https://img.shields.io/npm/v/pg-listen.svg)](https://www.npmjs.com/package/pg-listen)\n\nPostgreSQL can act as a message broker: Send notifications with arbitrary payloads from one database client to others.\n\nWorks with node.js 8+ and plain JavaScript or TypeScript 3. Uses the Postgres [`NOTIFY`](https://www.postgresql.org/docs/10/static/sql-notify.html) statement and subscribes to notifications using [`LISTEN`](https://www.postgresql.org/docs/10/static/sql-listen.html).\n\n### Features\n\n&nbsp;&nbsp;&nbsp;&nbsp;📡&nbsp;&nbsp;Send and subscribe to messages\n\n&nbsp;&nbsp;&nbsp;&nbsp;⏳&nbsp;&nbsp;Continuous connection health checks\n\n&nbsp;&nbsp;&nbsp;&nbsp;♻️&nbsp;&nbsp;Reconnects automatically\n\n&nbsp;&nbsp;&nbsp;&nbsp;❗️&nbsp;&nbsp;Proper error handling\n\n&nbsp;&nbsp;&nbsp;&nbsp;👌&nbsp;&nbsp;Type-safe API\n\n---\n\n\n## Installation\n\n```sh\n# using npm:\nnpm install pg-listen\n\n# using yarn:\nyarn add pg-listen\n```\n\n\n## Usage\n\n```js\nimport createSubscriber from \"pg-listen\"\nimport { databaseURL } from \"./config\"\n\n// Accepts the same connection config object that the \"pg\" package would take\nconst subscriber = createSubscriber({ connectionString: databaseURL })\n\nsubscriber.notifications.on(\"my-channel\", (payload) => {\n  // Payload as passed to subscriber.notify() (see below)\n  console.log(\"Received notification in 'my-channel':\", payload)\n})\n\nsubscriber.events.on(\"error\", (error) => {\n  console.error(\"Fatal database connection error:\", error)\n  process.exit(1)\n})\n\nprocess.on(\"exit\", () => {\n  subscriber.close()\n})\n\nexport async function connect () {\n  await subscriber.connect()\n  await subscriber.listenTo(\"my-channel\")\n}\n\nexport async function sendSampleMessage () {\n  await subscriber.notify({\n    greeting: \"Hey, buddy.\",\n    timestamp: Date.now()\n  })\n}\n```\n\n\n## API\n\nFor details see [dist/index.d.ts](./dist/index.d.ts).\n\n\n## Error & event handling\n\n### `instance.events.on(\"error\", listener: (error: Error) => void)`\n\nAn `error` event is emitted for fatal errors that affect the notification subscription. A standard way of handling those kinds of errors would be to `console.error()`-log the error and terminate the process with a non-zero exit code.\n\nThis `error` event is usually emitted after multiple attempts to reconnect have failed.\n\n### `instance.events.on(\"notification\", listener: ({ channel, payload }) => void)`\n\nEmitted whenever a notification is received. You must have subscribed to that channel before using `instance.listenTo()` in order to receive notifications.\n\nA more convenient way of subscribing to notifications is the `instance.notifications` event emitter.\n\n### `instance.events.on(\"reconnect\", listener: (attempt: number) => void)`\n\nEmitted when a connection issue has been detected and an attempt to re-connect to the database is started.\n\n### `instance.notifications.on(channelName: string, listener: (payload: any) => void)`\n\nThe convenient way of subscribing to notifications. Don't forget to call `.listenTo(channelName)` to subscribe the Postgres client to this channel in order to receive notifications.\n\n\n## Why another package?\n\nIn one sentence: Because none of the existing packages was working reliably in production.\n\nUsing the `NOTIFY` and `LISTEN` features is not trivial using [`node-postgres` (`pg`)](https://www.npmjs.com/package/pg), since you cannot use connection pools and even distinct client connections also tend to time out.\n\nThere are already a few packages out there, like `pg-pubsub`, but neither of them seems to work reliably. Errors are being swallowed, the code is hard to reason about, there is no type-safety, ...\n\nThis package aims to fix those shortcomings. Postgres LISTEN & NOTIFY in node that finally works.\n\n\n## Debugging\n\nSet the `DEBUG` environment variable to `pg-listen:*` to enable debug logging.\n\n\n## License\n\nMIT\n","readmeFilename":"README.md","gitHead":"b2bee3c158a2a0e6b7d8c194f49f027d30ac2aca","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.0.0-with-cjs-hack","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-bBqDARkiLRGr1yGmS3YOHFvOW9ZMRvLY9EGtN1qvlGAR2ugzWvikt837q9A2K0P3dFEXtEp9pTnAgMGuLHHAng==","shasum":"00d936508cc9e7c8ae43d9f428e9cbfd16bcbc83","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.0.0-with-cjs-hack.tgz","fileCount":8,"unpackedSize":23857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPDoACRA9TVsSAnZWagAA+DAP/32XiD6WswlULBHHr7yD\nxT9qzBonMWszN3rdpJv+gjSrojNFOHlecIV8bKzovO4qanZ6gTe5PAJZJMZ1\noz39WzijgVm/orIBxV+MYCoCj2MOsdOwt83TJ61ruHo56d2dsLxTjZm0zvdG\nSZ1OkeoCfhxCPElFPr0z7qQJAB0W3PwfkY+x5Li5pionlMn7QcUwaaj7HIV/\nedj6PLNyLYnCinZ9dEOp6aHyBVmAwSBzwkPl4/iZjN75JEjDYamCsq+45eVO\nXLtvUI8JFiJvXBoUu99R8oGBbpRjui41yM7URVoOA5Hnvf8tw14OpStNrspa\nU+Lw+Afov9sZlqPIqmM6bo4b2fVYwJpWNgL7wTxDi6QlfPozhhHbunsPPLxh\n0R/ivMVJcx6ikAHNRhyS2FwAbCQy3L5l4sLStfxKqez4XhW2p62jPKYi54Gj\n4GbsjgFG4QBPCzglWiuYSXVSU35oa4TFhBCcU2gsYE8sShfOden7BTpk8Ir1\n/D+xYnk9jckXpGHIabkEHT0+AYkqrRtzTCj7uCxVPC/ZWucfxa0u6mw4BN1n\nKoLuGgeJdPiHg/xEj/oYnHu2TGU1xZPKlWNjB52Xi6lt5YnXKXl79XvtU6Hj\n0UkSTnkB4//drm4zY0Vp64mNI/BlBJWJZ++lKHEc1RSs2N4yVamJdbPodBiy\nnNHB\r\n=zDn1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICb8J3NbVua+UxSZt3zBgX342DlhvQhALBq+Qj2zayZjAiA+ZYpRVr5KNpQdsPmmFzzv26XMEIc2L3VBJyuFETs9Mg=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.0.0-with-cjs-hack_1547450878630_0.5332898345072381"},"_hasShrinkwrap":false},"1.1.0":{"name":"pg-listen","version":"1.1.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava-ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.0.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"0.0.30","@types/node":"^10.9.4","@types/pg":"^7.4.10","@types/pg-format":"^1.0.0","ava":"^0.25.0","ava-ts":"^0.25.2","lint-staged":"^7.2.2","pg":"^7.4.3","prettier":"^1.14.2","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","typescript":"^3.0.3"},"ava":{"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"25dedc255db579df8b122981babe4c704be9edcd","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.1.0","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"dist":{"integrity":"sha512-gXX7V/DZ1RCMtJmpFxSaVJM78YUme8AcohNEMmB0XOBvyhr4RhrHjroWLeLvql+sAP//yumGY8QTmJJs1owN6g==","shasum":"1adf89c903e0b1106679ab49bc890f045b7dcd8b","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.1.0.tgz","fileCount":8,"unpackedSize":23843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPOEcCRA9TVsSAnZWagAAHOEP/i4I+vnMcEAsCQ51Id0U\nDVRfUTKmGMAsvP0aSn/C475fyX7Fvz+D7lNB1J3rGCNXj2Mmb9Y54CGHKlSF\nCH+v/gdFEN1PW8P6SIPQ7HOEl8Wi7LeqBgrpMiVynjmmL7YgUWIrNBzh7wQs\nqx6lb1J2dhhjGjww+1x8wNBamFBoZNPs+zfnLTj1pGizq+KthUvIXCZmgpBL\n9SWkmwHmMHTBgU1q5rBiJppmHGS1WidTGZQyHYPxuACsHLFNHPKfumbLtgjI\naVycKjAcz/AVUuu582c1kyDZiVH/jLl0+sSKr9v37vBSEFJ23a+emNQj62y3\n3+mizpWPTfZRKBd2sw1kr9O1KNIZ/Z3s2nzRpO4Ji1aXw5ojQYK3/XD/j+Fb\niPigg5htKLLsirJhjMwfhi7Zbvn7fGmFH+09K+aBffdpmwqjZ6rHqYZrAnFc\nmh8AGEN/pmbGwaBPXNzg3oCkeIYozLOMRpv9HTw7CsnKE31+sOk9DwWvyHh0\nmW34kCZPdbwOmwcRrYBuDFdiHQ8OnPPvTDEcnlxj4yiCcbjqzIdBGItuSWvc\nzvWxFRkAZbxOqZ2qtLM//OiNvK4aJWWO5cFb202Fnr8XCUd47qhmxpLRsLAT\nTGTZBf8DID+cG51TlsaD09lHGVTQj+3MxNrN75+GgvD1LN5kxe88RqR7T/RB\niCOv\r\n=DNi4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACZB2OzVA1pbSVJunz0Rei1pL3pLX/+EMQdxf9apyioAiEAo/S6JUicLY/jQ5Vnt+rXyIiH5+yUbdgDD5Jxbk7/psU="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.1.0_1547493659962_0.45651001143438874"},"_hasShrinkwrap":false},"1.2.0":{"name":"pg-listen","version":"1.2.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.3.1","lint-staged":"^8.1.5","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"e1a540402bd5a96f72f619540d44578835826ae1","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.2.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9NwwGEvFeEzhGopn8SCtw28NQl5rxNGB3Y7tjbYuMURFg6bVwykhF7tEZ6PVrxuFUbnTTadfm1jslsrlk2fGLA==","shasum":"8219c3974ad70aa73c703c36ee5ed3df58ad8cdd","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.2.0.tgz","fileCount":7,"unpackedSize":24168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjj5mCRA9TVsSAnZWagAAHIAQAKDiHUX2VrIvFG9i/n53\nSzXp3+3ZHe07qO811jnHLe68I0oueppn0KYUQL1izx9CV5eeOY72dyToLnwr\nJLsILlHUG4OahVyf7gw4X/kq8ZLcLQbqxS2r42rkjWRuWcdbVNZuLzncDjPC\njSkWVS0/hZXALVU9cqC0Ad0mBT7S0RzfbfEhlwZWqDzK+vZt96GwDxe//1RU\nW6Qb/WN4vaVxYqCAdA8ST2/WOAkbwwsYqnOov5gj+Hfn8WVBP4c2omgszAOI\nPK6SqRfLDokIg+D5/vZe/9fo0nVQYhcr0DGkondu/BeHUHfS0s+RNkqfDbo3\n4JuEHWToeGk5qy2OxWWm7Bbhq6pU1KehTHdFFQrL7bIfU0ZzKKTX/YSBybJl\nIcb79FAWYN1MHjfectIcYsBt9wj79cPFwBjbr5pLnwdCBYoOeHTbl/S1yCNu\n8GgCjvjWmbNIV8+L5LY9qD49kz2a4mS4OR9719DPPtpeIYv3l5bcRk0RM7LM\nmSKpFqNZ1lQBnxc/IBJgsznVgyCIttk874sxm/Ksg2K0QVlNGAIBT0NoPgiv\nBmhTlheT+OVCroPD3y74lpzGa5l3sh18oBSnvqaQCNcW74bUKyjMAB6xlOuE\n0rmtsUStup9rIrXpaX5npoXJIjwhefdI0m0lwC+z/lWyhMdlda1pGw4/TktH\nxJXr\r\n=R9mf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+chcs8eqv36XvhIEp0QSjCWQ/dRtknkuGQ5hPN92o/AIgIemY7Yn72Umkl0EPecU0Phwcthl4BMo/LiBBSx2UqI8="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.2.0_1552825957293_0.5016956260786565"},"_hasShrinkwrap":false},"1.2.1":{"name":"pg-listen","version":"1.2.1","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.3.1","lint-staged":"^8.1.5","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"1b7bbb953838ed326527ff9a63abe2874daef5ae","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.2.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9vFvzxevF2Y2wNj3fxTtFPe+ZR97m0aXc+cpxOjjyXNEANbabX7h24RGgtyNhKn+/Kyix8VVv/7xa4476rfYoA==","shasum":"63728032a8486f2c7da1fecb8765eb2d9f23709c","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.2.1.tgz","fileCount":7,"unpackedSize":24009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcz9+gCRA9TVsSAnZWagAAC04QAImkJpqdsKHWc8FPWxCJ\n/SOTvOCLKaRiOzv8zT8wk/5fPh00gC4qCuj95GXRFU226GNj3UwlxW4dm9rS\nQnN1HuMbIYq+pFlP2MgGLuObExJ7FL4CJFpYVCZTQDdeeAc4YOxBnojh8AYo\n9QxD3gK4gB3+s3nkgcgFHr6uN4pgOQXSBh3lCa/PVoO21+zePU+YTd9FaHsV\nenDOgFtPqBMkaTuqyBl3l9yojCkpR8ToFa13FKfuUl7w99OcQpy4QwZOK/qP\n6jQXr2WYnmlDRnLvP4ViGLYh4LklxYaMpOY786+fjh/PdkqJqiOLHbpuhcbZ\n7AuaY7+C9SICUgMEhPJLoT4jVpOJXaC9RlMrIDyYWeVvEdUpMEAmbQHb6Tqt\nrdgP5ZRkyENlmRvB3YNd2U0TC3DTbMKmQ/F/Xj1/nrbkxLsfJY4yR5C8kHAH\np/E+YOsCX8Aao8M/dfz1lnwF/5SB945IHVw6ctFacB3ayujvbeCv0llkpqMt\nI/XXme17U8fPaZKMK7sqTZH9PIaFQPjofM5eLlKj2ryUFvZnTx9GpRbOLkQY\nlxriEBdeVZqY1MSkaUfJLvBEJk6HkiCv85pOyQYKad/l28kY0b2RqrOWlf12\n6S6tGVKiPBInpZC3tE6cTGJc0jOm/innLN2nkerxg6ruijU8iU9WiPc9nWwa\nWYiB\r\n=Kopx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmgldsjCvhi8bMvZ1TqJohXot0VvwO/MNevPwbRK9dAwIgXDw8lXGt9vt78T5WXC1hA5FikCxrhaI3JjBuzgFMniI="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.2.1_1557127071991_0.3251995423661018"},"_hasShrinkwrap":false},"1.2.2":{"name":"pg-listen","version":"1.2.2","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"09442bc7eda383a4e52a60f47852b919038bf82a","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.2.2","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-8d9rknweGAHq0Ybdrr5+MMBzoDDvDv2bFPAOcUl6G2+lQ6JQ5pDaKtvyCA4LpF3DfqSOupwq8c2pBdZy7+RVCw==","shasum":"ed915dc25463d6822048adec74e1ff61eccf424c","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.2.2.tgz","fileCount":7,"unpackedSize":26459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc27rmCRA9TVsSAnZWagAA/RwP/0iBiA6uED6sSNtesBN1\nkvkBL28q9SH/KXEODLwpLJdGFFUcSC2pZeHrAcw1if9kkxZ/qaTQw6nJmP1P\nq1oHU7eHPnZvIfGQX6ZHmeQ4oYfIdzpkoE8bTOp4j+uqpdkazREI3otb4tLz\nzzZ2e+vXIY3Ykv8kXyGDOSvS9AL0oBH+vy4dGo5zsQqoIuRYuD3CRNM023yi\nvyeiWZkO1MuiszIrjbBqHJW7sbFv55LFOiOJGGRgkjYCX6pbRtj9j0Bn5wzn\n384UrqSPGsTKQ7lfN/dQAu+ez+jQ5omDg4eaduica6F08YudS6bt4TLE5yWG\nS/8iE+3a7t91FaDyiV0eTXFMdJQRMAJLne6k4XJ6NRRYqZtBvGE0htyp/S39\nofQjEdjoeiZA3QUza0hPQTkcCthZLpt4mT9TFekcJPmUJJtySle4AMo86R6v\neyYVCWCZ41WfnoHXlm2z/F8jxqNdagdZdYEyJk1anQYsajNurMazGoipJr7u\nxKP4rEIkoLXDjZ8KJF+w5AawHFVLtvY/IRQHic81orbt+3vJlL40h7cRizKz\naIHzfYUE065KqGsw/5bHlXVzzK2phHaV1qA5ygkI2+K9hxSjlQ1vVsKZxB91\nenZJWUeHOn+wAUK86Nr5yk/7K6HKb+p8lqVbA9PUNVke95SQbI2Oc6cbt4LZ\nckiG\r\n=BoGc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnuuUVqJlQwOo7ppz7RLygCm2R5q7JzGSrKti38tmSoAiAGWOxe2itXUyWwo+nRqdmJqQ2wlRAUZ0eLpd8m2mGCrQ=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.2.2_1557904102102_0.6151189937759518"},"_hasShrinkwrap":false},"1.3.0":{"name":"pg-listen","version":"1.3.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"42119594095b1804dead13091b7b37e2aa5d6f25","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.3.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+c6MSAzMjCWpmKiH/YtCp6wqu+kAe9zXped32ovE9z2LmEm0QjjHr6LBvwEEZ01pDm5D9bROf8f8DGflsQ/a3Q==","shasum":"dc39387134b4f5ed2ee7bb96e5a9a63d3f2cad19","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.3.0.tgz","fileCount":7,"unpackedSize":27079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3Dd9CRA9TVsSAnZWagAAwtYP/3g9T25gvI3N4IdTT4BN\nYrzayXChgYnejqxlPjFj2GOK5u2bPH90LT+KBAU+T0xr84dPMo9ixjpy4sTl\nw3+rpen8veaPmerlRlSiZGS4gjbONFM0EjheW52lWEmnE7S07oUBBsoK/+nr\nGCIE2OclkCnlpGDAMqEFb7ef1bZNGBOfLMRtgdaAoCb9vRu112IzHXuxBmQY\n9u2XKuh476U1d7ymUkP4Ru/YRs/QF431W27EYDmnxmv7RZ/qHxJKVDB3SVUS\nLcWttClJLoo0DHnwcrPxCJCGeq+gsmgds3yoQ2CShGzN7iMuKO2lgj4Lbp87\nOCvKJrGwMHEsjNncJCHn2PkgcpmUPxqGFs0QJMFWmCROK2kyCkO6LsMqbtyT\nbyqFf5GvnPzK09G9wbOAU4DMtv67gTqKeSIv7sPAO4yrkD9Ku8DbHAXq/u+g\nEYTzgQ0aTJhT1K0YPAfOGBouA2dB16UGrEGCq6L9XM7ha3/seCofM+iBGkVe\n8iYr/goIqXS5PU+yvCtRx6vzialQvvkFmROp9Gswh9KxFNS8v1BdxYlb+wwL\nIVfPRViXvlKPelrmrSE07avqNmnIEUDtXypdDmiZC99wB22Z7yRcHxGjQs2C\nNoY0/l2U2I5dsCIZ65KpukzUJpohi2qY5NC3g7cA+tIDeaQSVebiyC2FRcG8\n742B\r\n=pZEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBS7JPXOEuAcoDklrqQVrdVLfwTKAvXTn/EGRjT/EhvAiBvTmjt3Dmc0/BIkDRoshNeaI0k7I0Akr17GwI3qGMVyQ=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.3.0_1557935996221_0.9441494938076433"},"_hasShrinkwrap":false},"1.3.0-unhandled-rejection-fix":{"name":"pg-listen","version":"1.3.0-unhandled-rejection-fix","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"readme":"# pg-listen - Postgres LISTEN & NOTIFY that works\n\n[![Build Status](https://travis-ci.org/andywer/pg-listen.svg?branch=master)](https://travis-ci.org/andywer/pg-listen) [![NPM Version](https://img.shields.io/npm/v/pg-listen.svg)](https://www.npmjs.com/package/pg-listen)\n\nPostgreSQL can act as a message broker: Send notifications with arbitrary payloads from one database client to others.\n\nWorks with node.js 8+ and plain JavaScript or TypeScript 3. Uses the Postgres [`NOTIFY`](https://www.postgresql.org/docs/10/static/sql-notify.html) statement and subscribes to notifications using [`LISTEN`](https://www.postgresql.org/docs/10/static/sql-listen.html).\n\n### Features\n\n&nbsp;&nbsp;&nbsp;&nbsp;📡&nbsp;&nbsp;Send and subscribe to messages\n\n&nbsp;&nbsp;&nbsp;&nbsp;⏳&nbsp;&nbsp;Continuous connection health checks\n\n&nbsp;&nbsp;&nbsp;&nbsp;♻️&nbsp;&nbsp;Reconnects automatically\n\n&nbsp;&nbsp;&nbsp;&nbsp;❗️&nbsp;&nbsp;Proper error handling\n\n&nbsp;&nbsp;&nbsp;&nbsp;👌&nbsp;&nbsp;Type-safe API\n\n---\n\n\n## Installation\n\n```sh\n# using npm:\nnpm install pg-listen\n\n# using yarn:\nyarn add pg-listen\n```\n\n\n## Usage\n\n```js\nimport createSubscriber from \"pg-listen\"\nimport { databaseURL } from \"./config\"\n\n// Accepts the same connection config object that the \"pg\" package would take\nconst subscriber = createSubscriber({ connectionString: databaseURL })\n\nsubscriber.notifications.on(\"my-channel\", (payload) => {\n  // Payload as passed to subscriber.notify() (see below)\n  console.log(\"Received notification in 'my-channel':\", payload)\n})\n\nsubscriber.events.on(\"error\", (error) => {\n  console.error(\"Fatal database connection error:\", error)\n  process.exit(1)\n})\n\nprocess.on(\"exit\", () => {\n  subscriber.close()\n})\n\nexport async function connect () {\n  await subscriber.connect()\n  await subscriber.listenTo(\"my-channel\")\n}\n\nexport async function sendSampleMessage () {\n  await subscriber.notify({\n    greeting: \"Hey, buddy.\",\n    timestamp: Date.now()\n  })\n}\n```\n\n\n## API\n\nFor details see [dist/index.d.ts](./dist/index.d.ts).\n\n\n## Error & event handling\n\n#### `instance.events.on(\"error\", listener: (error: Error) => void)`\n\nAn `error` event is emitted for fatal errors that affect the notification subscription. A standard way of handling those kinds of errors would be to `console.error()`-log the error and terminate the process with a non-zero exit code.\n\nThis `error` event is usually emitted after multiple attempts to reconnect have failed.\n\n#### `instance.events.on(\"notification\", listener: ({ channel, payload }) => void)`\n\nEmitted whenever a notification is received. You must have subscribed to that channel before using `instance.listenTo()` in order to receive notifications.\n\nA more convenient way of subscribing to notifications is the `instance.notifications` event emitter.\n\n#### `instance.events.on(\"reconnect\", listener: (attempt: number) => void)`\n\nEmitted when a connection issue has been detected and an attempt to re-connect to the database is started.\n\n#### `instance.notifications.on(channelName: string, listener: (payload: any) => void)`\n\nThe convenient way of subscribing to notifications. Don't forget to call `.listenTo(channelName)` to subscribe the Postgres client to this channel in order to receive notifications.\n\n\n## Why another package?\n\nIn one sentence: Because none of the existing packages was working reliably in production.\n\nUsing the `NOTIFY` and `LISTEN` features is not trivial using [`node-postgres` (`pg`)](https://www.npmjs.com/package/pg), since you cannot use connection pools and even distinct client connections also tend to time out.\n\nThere are already a few packages out there, like `pg-pubsub`, but neither of them seems to work reliably. Errors are being swallowed, the code is hard to reason about, there is no type-safety, ...\n\nThis package aims to fix those shortcomings. Postgres LISTEN & NOTIFY in node that finally works.\n\n\n## Debugging\n\nSet the `DEBUG` environment variable to `pg-listen:*` to enable debug logging.\n\n\n## License\n\nMIT\n","readmeFilename":"README.md","gitHead":"5756fe3dff87f2e88da276495a15e2757e24fb60","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.3.0-unhandled-rejection-fix","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-uTd9DnjUOVu427h4IXmeT9m6/99KOpK1/gZz9AFmDNqFyzmjrU2iWexBDr9ez/aQcvnjo626RclLZ+9FZVzmSw==","shasum":"3f67d651291b36bf8dc5dade194c073bd80a4f10","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.3.0-unhandled-rejection-fix.tgz","fileCount":7,"unpackedSize":27103,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIwYpCRA9TVsSAnZWagAAU+sQAJu2Ne12he1lTIP69O83\nTRwLt+peeJvp2etIETpCwP55At7Yl6dIr748vYyZxN1LCiAdK1muzD6XwHkQ\nHDQ7V1vRoz4lSu0tvuzyNJNr6DeZRqpJyIKNjgeNdI7Dsn7ZIbqNYoRHojfX\nRb3H+XSUuXBa3ljWdiaAZ0GzID2Cpi7+t4rC6iviuzVAyZRgdWzFQhCPs5B2\nfbrooZpZWlzePORa5z1t+vbqFVqn+XFhWlt7lfZng8fsW69tWeZ/fVdnRdqj\ntkvqXaO+Q05WMl8UR96wJWaHMVokhd8RM7rU+EbUoONjARAsMWTgE1c96jmv\nYS8IMsnaPtvbiT0WQ5JHkFLF8rM7IUM4q6xq25Fkh3/5WpDkRyGORiCxIUj2\n6TOhl9EDRCK04WZMSZGHiPsgH6yiHHAeQ9j9QIoCigsRBpCz0QImUXsnreGS\nOMjk78kpQJjSZZiVxiXaa7dBS7xbs90ifPbymeieJKtJUCmZaDzspi8brX6W\n9PpupLS1oP+9MBmLOq7EiFHUR9e4stP/GcOjWk6aQ6/TC5YZakMIyoPUjRw5\noV7i1ivFvbBL8MtXlMkpbC0QHVP11bFpYkbmT0KL77Z8toCpcoEYUB9Fo+s7\n8frhOjRJEhwKyzCA+o8w0liif7nPUoY+QWtPq4ODGxCNnO79Zz+k0ufQyl92\nhG4T\r\n=lHb1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNKpkrjHeIbk4SYF4q/VPb4EcLuMl01S0uyuIq6T1J1AIgUXylJToSeiXorLZLZXsM83d4AK3z2AivIY+ji40izAk="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.3.0-unhandled-rejection-fix_1562576424761_0.6906160515626774"},"_hasShrinkwrap":false},"1.3.1":{"name":"pg-listen","version":"1.3.1","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"b0727992db97abf31fb60f4addce012e627b8b37","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.3.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-wApDWmiRoRhlruR/Bi4WIPQjJQqWnePl1uJLwtrzaFRNdKIrhkO6nVaZyr2cUkpR7zf9F6iEpoOA6pVpvtpKdA==","shasum":"42ea8122dd118879f65df3a176155a8494b2202a","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.3.1.tgz","fileCount":7,"unpackedSize":27079,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIxBNCRA9TVsSAnZWagAAVnIP/A2/N3oFUfMUvfoL5iQP\nPL7ybD8fS11Yct082WctBR9IGV/gTX8cNvSd19+oNPJCpCEj9KRZv3eW4JVQ\nN0g7AVK5w9YGinFB4YnXSjR6fG/w8kIDIm3jO0KL8f+1kNljYZjSFYM0vozV\neaJ9M0t7wYnhGYAuDMTbTl8RnwNaXYxhcYaYN3EonPEAajh911iqK3AQrjU/\nU8iBHhykoirf+XQQ6q3Ur9S7PWLRq2tPakaSZQzTBUpPrmmcctZEeeUCn7mv\npXL2T8oGhxvefx6l3KKjgTUVGpW1mYvPqjDnqx1StzCOKeWN78BzfbiVC4lo\n6TLJIQzulOB6m+RlFBJBllszOZlpQoT5QP+jJkFrS0nME08G8Pha3XhkLAXo\nJpMMjIhfY7lXnpBb+sAeESK6affdXaAFkOeZ40dNDuFojwLlA1gBPETg0KHU\nRaJfddsycTIU0v11ccP71UlEntS5CU6ykuUNFKJ+FbKhruI/9AAF7917Q335\nI5J290WIrcuB7lYy/DQX1X2Ldu75en4XBO6Us8DQ0IBHLNIe9qY8Uh+rGipN\nJWEmUyC+s5KFynunc5acAtiTmRE1KL3OM88LpOgEeRJWa/xqnU3OBvU2tSsX\nHhIKOArNml5BG9ZfERdqPxEaBeGZZm5GBokwgCrOTgbro8zlDiqdh/aWanUp\nrtTJ\r\n=m9lr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBzSxvLFfgzMg0Lf4vs2GHlSISI2y+sasygpbG8+vaGwIhANJlaxEDI5wK1ksz4DhBExbiATsz/03WRaJuMvT6kH+U"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.3.1_1562579019964_0.056421977420467506"},"_hasShrinkwrap":false},"1.3.2":{"name":"pg-listen","version":"1.3.2","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"d39914ce93f5190b339c7cef240008a5d685d2dc","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.3.2","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2Mz2ej45yBN/LonO4RMkTLMnP+rlfLzvvFDHsDfduKwLZ7P1zV+ms1XOm0sVbr/2aamUQHnvxrXAnhsymLnjYA==","shasum":"87989171e2cc46d311a641726253d4d17eab4486","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.3.2.tgz","fileCount":7,"unpackedSize":27253,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSiPTCRA9TVsSAnZWagAAyMgQAIIBwq6UKJ+bF93cUhBY\nWcTyC6SEG4fdX7YPQBbOUYY+98C7rb6pFfedOvywmaVxMxFuWyvI3UYClbvp\nEfvZQaZZjM6z/1UPe6SSZ4hd5R2TeZYQU7DWZxrZ3TTlJUAmEUMbHViUMVbn\nqHR2qOyKngHqILytS7FES7/xtyzcEjBRGh0mEpZZY4Hf0V+2Os/vgSjUkeRG\nVR1VHA1fZevHnpvdJoHBe2hKau4y6skulTsPaoNXP/Rad8RhJvuGkkxDbrVv\nd5EKchmwvz/Nq5QybZrQQs14qHFBSr88bk5eyzBfRNYEC7Qm+EYqHhXWzfL2\nIv/S9AizOXXrJGr6qsrLR60R2fJG1EX8QWsxzUYoXxbKwJCYuROSzkohN+20\nr65MenRtL1HBGdCWRgjXaVEaqN/+GxaLRj1dk3PjiLKc9zR20apAJt22iCnB\nW+1N/cUtuN9zQdMEUUdBx2gB6Lovx2QxzHhE7CFHLB/spkLB8o1euhkNDRam\nV7jYr3u1L3slrT8lJl7ZXHVhwyz+T9Etaaz/fL8ZCHHKtX/l8Ozw9yApRI9Q\n8ThMZcrcJTb1AJpKWwSSfDEChELWNNy8pMRrjwxlmD7GtwKepgO67dk9aHjB\n/MYHGeRb+ORBBDWa3voRnssbhtSnEScI7T2PRrlx2uspmUDDHXJv0n8Mcj7/\n6IHE\r\n=aA+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCECquB0Ez6zFChBGsj5MFEzm3oYy463jDC7tkZbKKCIgIhAJka5ZE6cchRZdv1rOPPYZmr0nE51wXtzy0IboE4GC7z"}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.3.2_1565139922995_0.8002914425312473"},"_hasShrinkwrap":false},"1.3.2-connected":{"name":"pg-listen","version":"1.3.2-connected","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"readme":"# pg-listen - Postgres LISTEN & NOTIFY that works\n\n[![Build Status](https://travis-ci.org/andywer/pg-listen.svg?branch=master)](https://travis-ci.org/andywer/pg-listen) [![NPM Version](https://img.shields.io/npm/v/pg-listen.svg)](https://www.npmjs.com/package/pg-listen)\n\nPostgreSQL can act as a message broker: Send notifications with arbitrary payloads from one database client to others.\n\nWorks with node.js 8+ and plain JavaScript or TypeScript 3. Uses the Postgres [`NOTIFY`](https://www.postgresql.org/docs/10/static/sql-notify.html) statement and subscribes to notifications using [`LISTEN`](https://www.postgresql.org/docs/10/static/sql-listen.html).\n\n### Features\n\n&nbsp;&nbsp;&nbsp;&nbsp;📡&nbsp;&nbsp;Send and subscribe to messages\n\n&nbsp;&nbsp;&nbsp;&nbsp;⏳&nbsp;&nbsp;Continuous connection health checks\n\n&nbsp;&nbsp;&nbsp;&nbsp;♻️&nbsp;&nbsp;Reconnects automatically\n\n&nbsp;&nbsp;&nbsp;&nbsp;❗️&nbsp;&nbsp;Proper error handling\n\n&nbsp;&nbsp;&nbsp;&nbsp;👌&nbsp;&nbsp;Type-safe API\n\n---\n\n\n## Installation\n\n```sh\n# using npm:\nnpm install pg-listen\n\n# using yarn:\nyarn add pg-listen\n```\n\n\n## Usage\n\n```js\nimport createSubscriber from \"pg-listen\"\nimport { databaseURL } from \"./config\"\n\n// Accepts the same connection config object that the \"pg\" package would take\nconst subscriber = createSubscriber({ connectionString: databaseURL })\n\nsubscriber.notifications.on(\"my-channel\", (payload) => {\n  // Payload as passed to subscriber.notify() (see below)\n  console.log(\"Received notification in 'my-channel':\", payload)\n})\n\nsubscriber.events.on(\"error\", (error) => {\n  console.error(\"Fatal database connection error:\", error)\n  process.exit(1)\n})\n\nprocess.on(\"exit\", () => {\n  subscriber.close()\n})\n\nexport async function connect () {\n  await subscriber.connect()\n  await subscriber.listenTo(\"my-channel\")\n}\n\nexport async function sendSampleMessage () {\n  await subscriber.notify({\n    greeting: \"Hey, buddy.\",\n    timestamp: Date.now()\n  })\n}\n```\n\n\n## API\n\nFor details see [dist/index.d.ts](./dist/index.d.ts).\n\n\n## Error & event handling\n\n#### `instance.events.on(\"connected\", listener: () => void)`\n\nThe `connected` event is emitted once after initially establishing the connection and later once after every successful reconnect. Reconnects happen automatically when `pg-listen` detects that the connection closed or became unresponsive.\n\n#### `instance.events.on(\"error\", listener: (error: Error) => void)`\n\nAn `error` event is emitted for fatal errors that affect the notification subscription. A standard way of handling those kinds of errors would be to `console.error()`-log the error and terminate the process with a non-zero exit code.\n\nThis `error` event is usually emitted after multiple attempts to reconnect have failed.\n\n#### `instance.events.on(\"notification\", listener: ({ channel, payload }) => void)`\n\nEmitted whenever a notification is received. You must have subscribed to that channel before using `instance.listenTo()` in order to receive notifications.\n\nA more convenient way of subscribing to notifications is the `instance.notifications` event emitter.\n\n#### `instance.events.on(\"reconnect\", listener: (attempt: number) => void)`\n\nEmitted when a connection issue has been detected and an attempt to re-connect to the database is started.\n\n#### `instance.notifications.on(channelName: string, listener: (payload: any) => void)`\n\nThe convenient way of subscribing to notifications. Don't forget to call `.listenTo(channelName)` to subscribe the Postgres client to this channel in order to receive notifications.\n\n\n## Why another package?\n\nIn one sentence: Because none of the existing packages was working reliably in production.\n\nUsing the `NOTIFY` and `LISTEN` features is not trivial using [`node-postgres` (`pg`)](https://www.npmjs.com/package/pg), since you cannot use connection pools and even distinct client connections also tend to time out.\n\nThere are already a few packages out there, like `pg-pubsub`, but neither of them seems to work reliably. Errors are being swallowed, the code is hard to reason about, there is no type-safety, ...\n\nThis package aims to fix those shortcomings. Postgres LISTEN & NOTIFY in node that finally works.\n\n\n## Debugging\n\nSet the `DEBUG` environment variable to `pg-listen:*` to enable debug logging.\n\n\n## License\n\nMIT\n","readmeFilename":"README.md","gitHead":"a1ed4f2ddd029aff5d29de4d36e5e56fdef600b6","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.3.2-connected","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4Ot4Rv6OavsGgcCD0t0kTYZlfokHNy9XufjRpm0oThSkPtJrjyxf50LBkTbqnHuI/bKz9KawkcAuVhZmeQ6LWQ==","shasum":"68755ef44df61ea1296eb71795dea5e7e5927fe3","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.3.2-connected.tgz","fileCount":7,"unpackedSize":27754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJda72lCRA9TVsSAnZWagAAIcYP/1yhzh+jzSruEsYI5rLm\nKvfbp3XoVjCGzC+9KUwnnCVNY1XXdm6St1kZnuVw4E5O15PweI/P2232XCIa\nCL9ucS2Ax4PDT/U1wU3tjgfZvfG+rfvJg3SWD4mx6KIRf5FpKpTIWMkTfSrw\nTamtquubyFH1uwq2ni/jyALFPSmudbY8HmXA+Xn604/Qxun+ccppfLkmB87T\nNqY9DhsCHY3gcWAGSZTQGQsDlqSlqri8ag5fJjPNjaYjIEQ+niFX0+M11Fr8\nFKQ1zbOSIwU+8XH/0f9i0J/sJunxYYSGBdpZDh6J9hNWW4AdEZPp/d5seerO\nUIFdvA8wb+gQMXeIikLgvDEzLVyxMDPQSpJ7biSDoB04323WECzAt5VxQaix\n1Fi6yUx5CbEH2AAbS6u8zZIFfMkn2u8g7IKnrk6yywYDxnFkl//qxG3irWnB\ns+5uXLigPrF8kQ171O+TvpROFTT4HcE1Eysy/JU7HtJ1OeVGDrfFuYxQhStQ\n1SKWML5H0cxdGLRCK5bUPA5uv7JaH2uIbvXMOruQFJMsEYSst2VIJkqxFvfE\nBaBUwVzgPC3UjosIL8EfEEuP1wdb1V2Db40Msi95sqcU8Y+WQ9O9mB+qZZPm\nIfHDbl8hPjf943/YanhwB4ATMlbSnIg206nrNGdy1Ws+p9TXsWNRLgYw12j9\nKfZv\r\n=5tQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/m0UkkRE3qYi8fO8PPImw3DUvGEHPd213G/YGjHWifAiAlCWTMs7ytN51XzzyJ4QuOh/lYYpn7gVnwFIoHA9An0g=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.3.2-connected_1567341988722_0.6758462302845583"},"_hasShrinkwrap":false},"1.4.0":{"name":"pg-listen","version":"1.4.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"d37ead94d89e7ec8cca5d00f8f973ee29fcd393d","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.4.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-X14kIc1XU5pvfkZ8d6JMAlcm3sbAfU/HmD20n/GJ474RQsANH7gKc5jPetvbCRf52mGJRrhNojLAQfRhxi+3qA==","shasum":"5ec79558840bd321c18e7ef811002c3a7867f41c","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.4.0.tgz","fileCount":7,"unpackedSize":28123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJda/bbCRA9TVsSAnZWagAAdLoP/ReDjVXDRXcJVWVowWrp\nv6N4AcPlgFuKChayulg7wuWJe9QFvsCllDzz5HLui9PmX0DwlMvImFFwazF2\neeSuzL6ku7UG6OO8nRbEjTWRXmcNhbkGRuTHsgX35VLQoAbZ1eZubX0QC5IB\n4X43nKKFqGczm9cbu2vyeHykjrZIRfjGBWOfqwOHZw6H0XdCRtIAxC1amBM1\nlzue6ssmiwa0qqI8rdqibzne5TQ2VGsxwvX72xJZ2Y7bI9+/kkDA6DcO4K6X\nmMZyHviz0v08FOAQMmZI6F1eTuOjtQQQYBOWZEjgoUMc82JOyxFpnbT23X8t\nwhOfQhxsYD0Zhzd5ggHae3ZMd9hp/yMGbgafcwZx0QJlCOS3YtxMw5bgQZs+\nkFh7WEJAYudDc5PmqiV2rhkyvIiiw9cE9MJ3DY8h3nNtBsF1M+r9e+su3YUZ\nsjXsi7i3cZp9zTO32yGmsG7vPC2eoMAKEgUmyjSl9yYcU0kEXbc4bTauFNcW\n1kCksf99RtxAzgxjASDraIiuqJMxA6fj7vbc2HYiyABphQ9HoS7V/5LP6Lfr\nzYYj1cdcK+QwhdVaxD3x1G1jHe48TS5TJjZTpB/cgRmcnML1x58D966Ud/rP\n8v9dF6yRp7wX6tsvrYk4P5qOnwZaeXtb3xGVnIUli+hrfNdYd7Q8NjPwRcrh\nr5Wn\r\n=gle0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZkfBfuINh2YQsCrdLq5avmU68Nzgzb5Zwe2r6vHrHnAiA5p4nq3EPJAB3aySWsVC+RcL8vYlZ/NN5DEtV+UtWp3A=="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.4.0_1567356634530_0.1767038161148491"},"_hasShrinkwrap":false},"1.5.0":{"name":"pg-listen","version":"1.5.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"81286d5db3271a2fb67fc58ce1c10530867fc63f","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.5.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-eSDl0SadfeDVk04V9JwUa7g6LSkfobtlMGZ6ELiRG26Tly/EoLyoFkbJ7P+pMwv+kVUNcyliKZ4JxrfB7bhJ5Q==","shasum":"1e61a5950a05525de73fe7bf2a07c2f99638632a","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.5.0.tgz","fileCount":7,"unpackedSize":28663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdc61ACRA9TVsSAnZWagAAawMP/3N46RfaPeeIP2eXkFSD\nLTmc/YWh5/LADNb6XCRhKtDkNOPNgAiH4m/fARKB1DJ/MVPBGNB3IYqKzK6k\nX38XzRqOPGW5XOUsZPMV4SWBKzWdRIJSoxlJPffepY2D8J71WHvdV2e9foXW\nDch/1QOhk3Lu+5qr/PAJZo8q7G4W7rkbxy1B11CkpggyeiuFQ5Yph8uFGk1N\nwG4GQlz6Idb+UtT3s6nFK1O9PeKUegbe1qNI0d5vLJEtHVU1jNFw5QxhewUg\nFSsWp70M9qkZ//pEg9RoAdRtjc0CfUPOiBoycoYetclZBVzNH1ehoWWShKPn\nGlDy/nt1jSyZPVjAcnul2leLYWzacuzMbROaLfiEyXPW8M0PJisMIdqaQibc\nKzEbeAQO71XSu6IfZmgQyL5+EOu45RPzy3Ti1lqef72dutnuyN5ZSpVkOA9s\ndUnGYNtg2riDNNK7c4RXBh+3DRkfxrt+/g8Ri7jrA++UDb/jvnLSdoBN4bR2\nUOz0jk1JihgXFPgDwPAhnMUhQPZiqvkJqT8f0WG/sBw5le52Ar5ANmLg9Ezv\nfBz0UUapB+4/zRHzfigXkOivPO+zQJJy5FyDRRg2PCjQEW4apTnlS64+prJt\nhLgD4y8fhgCGezkCboEfLekZf+FDMNTZA9TsYJQ+t8fWcKPqZGuXLsYCJqnH\n4IqR\r\n=4jO6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCANCQi0v2dKVWSdVdbVI8D9kpRsYE4GAgrJBH6R28BtgIgKSQjTWf3XXrva/U8pNSqH52/hfEPff7eQZweQnwW8PE="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.5.0_1567862079550_0.8272308241890345"},"_hasShrinkwrap":false},"1.5.1":{"name":"pg-listen","version":"1.5.1","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x || 8.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^7.9.0","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"6f6acf8196fff381cda147c81b90df654efcab31","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.5.1","_nodeVersion":"10.16.3","_npmVersion":"6.14.2","dist":{"integrity":"sha512-RLVOZvhGpUR1WguryJg5fjixoVGmKaHXYHdtVmCpa7+IdV2yIrVq79YBQ+6iqWiq106SgYPcJnACJgJHz0pQHw==","shasum":"12b553b59fd59e4d47df88b1d26c3ded8ee3323e","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.5.1.tgz","fileCount":7,"unpackedSize":28843,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepGCPCRA9TVsSAnZWagAAwJIP/0LVQwRsZJariXM+FXd0\n2jwZ4LHnuDC/B4wKOfwJ6S0vobSPSvT7KAsIPkATsMQfn95BPRsO61OZxF3F\nhxG4QRVgPyOMc0JINoQKiyM2M3fUfWmKAW7Kueyo6u7u12GIf3mZv2cPIxEN\njWfQo94TvHUjK+FRzLRtB1jmWl0pNq+XqhUKGQJRKsLhmMhOfeYssV+DM+1o\nxOx3WowplxotpzF2wVP0glT0pKVEOZQlQCpsXKlC1HXofcx6uxhDE3R4r0gR\nPmjGvgJYmhYJQgebSon3aMq77uPQLKKoZOoYhIGTuIcK/cUf1Hl7lgFe15YF\nH8Cb6C2LZp0DK505AEL9m/iyqM3OEQBBYdHyQ3/pIkAh7hwluJ6ttPYAkod7\nKTXzW2sHe6Srpy8H57i4BNCJg+vxGmGICysVU/iK7Tof/WcDeuRgeTRbxJ0j\nQhr+c37/DzuCEH5LytU4vdMSLhrsvRXb9n7TUTV0aTIEch6JriHp5BEeRVwF\nbb+mr6R7WoJS8Uq8rcdV4ogoZIFvzo09rzDQAkd4eZ4okJ4phd3HE9RUDkeq\nHU8XB62weCNE7vOkQwOnr7Bg2kyvBq/Qt7Ws3fMYBuRg1dW/7W9JG1W2ysux\nxGwDr6jm5a4ofUQu8N/nEVbre2US3xjq8mkqmrSH4yLNq0gplfpxLvqeV+DM\neL3H\r\n=kaIv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbcTkGRgD3yNwZXsWtqqQHbmNrOM/17h4SiPTSHr5v8AiEAldeB+kDTUHCReNRWhqi2WJXhzz7Q7Oh0ycehPzeiXYg="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"andy.dev@next-step-software.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.5.1_1587830926818_0.9976057631477595"},"_hasShrinkwrap":false},"1.6.0":{"name":"pg-listen","version":"1.6.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x || 8.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^8.0.3","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"d3bdf9ad13593d86c0dcce3260e6ffe81c395749","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.6.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8TR/u/rhckczPHUY2Vf2ma0pmguSazhrHYoSIDrGKn0XO2Ix93ZUBGZD4Pp6SxUU95psoktiJ6sy7DWYS7b4Qg==","shasum":"49c631114a99458685520159e03334155bb9f7df","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.6.0.tgz","fileCount":7,"unpackedSize":29076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGx4XCRA9TVsSAnZWagAA5OIQAJL2IkeJBn/UOItkqhRA\nMF+ZTwpi5VpPcIG1cKGkLxfD2SqtownCUt8crL7M6BusScjgGc7Xzp5W7ydX\n9M9d8WFLbgWkVlbn0EroWxl4W7cS/Xc6h3u4yN/qBLq9r1qhNHK7yPJo1WaB\nZrEpmd8vI0r4lGgtACPtzZVtXd6PgxtjsTWJOsyKCXkpYsPkC6xGibMMsUZG\npbXsz/8Ci/+MwlasNpHzo5xH4Zs/tkqzG5GuaHKWt9Hk9QTc1G8LWmUiQeXt\nq7NZ4AuylvOvTyh0l2WV4IoViqbppVC9JhoSEl0NdwHYsPSr5mGhS7i/H1kU\nSN1u3LYSdJnSD2JdEQroELj9sbVWqonIYpPhuVu4mVJ27rN7F5M8GBhFHHX2\nuSqDzgmeXvTD04XRHlBwloRGxuzr7LmeIWkrMK1/L396p+kDql0sBYsWq2Ww\nT8W2HXWYhlbNRS9GRDay07xuUcaSETbE08pVpq8HkCrnLrcAZVUz++i6jNGM\n6c5cijYu9/loFgsekNr9Tll2+fYiqPA6pCB88upP7ihvvpSk10FTk+koBNtj\nTSlB+cCMx+wUQss04cONMrm0esRyLP2vh/QUsuDlwNqdx5orqkDrKPL96poH\nsW3tBpafaWDwig0HR1x/cdPuHEY2cKflosb7uP0Uh3b2zqD9yXatYx7Fv+la\n3HTm\r\n=Klx1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/yHCUEwdJiHcQLeN33qTXNfGW5eekQKXg9y8FISsmSQIgLsheZ8WFcZks14cLNdPU5ak8RR5HfzqhB88z+fX5yfw="}]},"maintainers":[{"name":"andywer","email":"andy.dev@next-step-software.com"}],"_npmUser":{"name":"andywer","email":"github@andywer.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.6.0_1595612694338_0.5532756890668329"},"_hasShrinkwrap":false},"1.6.1":{"name":"pg-listen","version":"1.6.1","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x || 8.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^8.0.3","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"11d5e5fb81eef22c0b963594fe511bf2c167605f","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.6.1","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-sNqE4ZUNHBJcUhKV/e/Hw+SzLJvMEj1sS4rQgflrhcgPrb3Bz695Vqml5dqSN8Q9oce+pjuN+Nbo9oPMUkzeUA==","shasum":"ee1122863199edf6aff56e8fad7e2549b48ea784","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.6.1.tgz","fileCount":7,"unpackedSize":29156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyhOQCRA9TVsSAnZWagAAVkYP/i0lbFBNf6Dkobdd3LJ0\nYYBLjTAafgAuaz432klITH5NI2Is+IJxcrH85ssSwGNZemgOtDApJmWp8kdT\nndA6s+EaRSsY53bMDr1+o6A+ehf1CI5PEVcx8BGu79hlkb+xYKUW2Pa8Whi4\ne+jeT9gJ580Bt1fu+GxjzWi51f1nQzCqFwjxaVO+M5E0Wguera9qP7Nl1gWX\n85lgjUgXJBJoVzc6zjxdagTz8a7eMtufiCzkHBUMpDj8qAYyGVw/KlnJCeKK\nNGRkZjLrachSdFBPe7jyEiwHB7tDYakZAfsCnkL7Kp3vmcnxU2efsCI5xyLx\nWFfucUaG/t+CEQdroK+wzubaQ6a9Cm0pkxCMtaF9YRIYHsIxAXKgJt6U6DPZ\nMRSiq9tWJVL+AzmElwj8/2F0hiDlK3mSePcGTvq/MhmBkCmWBAuhhuq7kVRd\n5LRTevU3/EkdFmCdIGQTKyQ5RWZh4cfhAlYZFbMGX3c8xnIXf94aL70rcxSf\nDnYXY4a5hL5EiX78zYhaVx9tTc6wRLk3VOZbf4YJ6FdBXDkfihj5Ru2CJ9Ew\nQGuV7o3fVFlGGSrFzYaBVkGuEmzD3H5cge0coFGamzaqnQLLuQfUZsrx3nJk\nNzpyl7P45aYDfnWay80Rr2RFY6yZxQPLUaCSL26/FMX/oLsCy3xAXcH7PVI9\n42sS\r\n=756Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAUSQYun9Jxj1YAP3xwYzpdIev3zsRhqX2ECNVgZpcbiAiAe+ICudhX+H2119h5fcZNEcObUt70T77E3jJ3q17dvTg=="}]},"_npmUser":{"name":"andywer","email":"github@andywer.com"},"directories":{},"maintainers":[{"name":"andywer","email":"github@andywer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.6.1_1607078799483_0.07580471563702473"},"_hasShrinkwrap":false},"1.7.0":{"name":"pg-listen","version":"1.7.0","license":"MIT","description":"PostgreSQL LISTEN &  NOTIFY that finally works.","author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"main":"./index.js","typings":"./dist/index.d.ts","scripts":{"build":"tsc","test":"ava test/*.test.ts","test:database":"docker run -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 --rm postgres:10.4-alpine","posttest":"tslint --project .","prepare":"npm run build"},"keywords":["postgres","listen","notify","subscribe","events"],"peerDependencies":{"pg":"7.x || 8.x"},"dependencies":{"debug":"^4.1.1","pg-format":"^1.0.4","typed-emitter":"^0.1.0"},"devDependencies":{"@types/debug":"^4.1.2","@types/node":"^10.14.1","@types/pg":"^7.4.13","@types/pg-format":"^1.0.0","ava":"^1.4.1","lint-staged":"^8.1.7","pg":"^8.0.3","prettier":"^1.16.4","ts-node":"^8.0.3","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.3.3333"},"ava":{"compileEnhancements":false,"extensions":["ts"],"require":["ts-node/register"],"serial":true},"prettier":{"semi":false,"printWidth":100},"lint-staged":{"*":["prettier --write","git add"]},"gitHead":"90ad4882a2a09c88e4bd5ea1d7484a5a16dc352d","bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"homepage":"https://github.com/andywer/pg-listen#readme","_id":"pg-listen@1.7.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MKDwKLm4ryhy7iq1yw1K1MvUzBdTkaT16HZToddX9QaT8XSdt3Kins5mYH6DLECGFzFWG09VdXvWOIYogjXrsg==","shasum":"5a5c68a1cabf88d2b78ed9cf133667f597d3b860","tarball":"https://registry.npmjs.org/pg-listen/-/pg-listen-1.7.0.tgz","fileCount":7,"unpackedSize":29178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3ipDCRA9TVsSAnZWagAAKUMQAJjCkIpnidlPh8TyFo01\ntgWQ7buK+Hvh/UTjyXl62mle7wL7GitArVBo/ZSdgIyVtPUTrbqDNT5ar5TW\nlrdFzCz8QV78U9yRhdLMx9iROXNgGWCEvrBTt5+7hCexJ6MT1ZtlFQv6bSoT\nUT4NQ4smJ3wpWA9mLl7NVbxnt9y8G1RkwhPzGVZPZDK6eHEDbvIzFrmd2jMs\n0f8gGlJepQsxPe5LIoxIkl5y2+/+QxjkPnXgVqKZsh63lSkdCHAntihQNomt\n3V+5Ty0ob29irlH8QK4U9mA0fI38vNJbh+u9bow9fW66QfilnRaIxVEin/yU\nmQ/p5pDrtW02jNvwZPLwXohSq/xF9XEfEA43wRqrdGfe5Igz+QOU5XWT4yZW\nTTgdts5K/M7C1knehac6DSq4quvsDOItfKW7xIwmypzjK3LIUFrVGj3PjqQd\n4IQ5nMXhw60I3KVi5XXVOeYygSIXZLYxVvHfHxyNZKQk9TK3tYYMOuWrxno8\nR2eaTsm99KJu0FkwPQMWJGTSn5/bR+EMT+EsVTRfJvt9cmVdTdT3+XNkgAZU\noVtMW6hvt8Q84U/nDYkGiskWLW5dTk1eDwovA7pxZByJTuLqqOHLXA6bCyeq\nuepvdrTE2QaY68HRb2lnzk+FKV41h2ipVUknmBBbG1LCafqSFxa6dbJKZsPt\nbTI6\r\n=4+4+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDywA9LyFSOo9SWmk5BF82ywHlfn/OTvG0qHhYbj7P6QAiBxyvBAvcvOSj27adapDFQhCTEksVxnp5RnG0A1x2Yfbg=="}]},"_npmUser":{"name":"andywer","email":"github@andywer.com"},"directories":{},"maintainers":[{"name":"andywer","email":"github@andywer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pg-listen_1.7.0_1608395331164_0.7095012031658561"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-29T18:33:18.015Z","0.1.0":"2018-09-29T18:33:18.186Z","modified":"2022-05-12T20:29:05.182Z","0.1.1":"2018-09-29T18:40:12.942Z","0.1.2":"2018-10-01T18:24:29.158Z","0.1.3":"2018-10-16T20:39:10.305Z","0.1.4":"2018-11-05T20:21:24.060Z","1.0.0":"2019-01-13T13:51:24.397Z","1.0.0-with-cjs-hack":"2019-01-14T07:28:00.432Z","1.1.0":"2019-01-14T19:21:00.077Z","1.2.0":"2019-03-17T12:32:37.441Z","1.2.1":"2019-05-06T07:17:52.127Z","1.2.2":"2019-05-15T07:08:22.248Z","1.3.0":"2019-05-15T15:59:56.341Z","1.3.0-unhandled-rejection-fix":"2019-07-08T09:00:24.935Z","1.3.1":"2019-07-08T09:43:40.117Z","1.3.2":"2019-08-07T01:05:23.211Z","1.3.2-connected":"2019-09-01T12:46:28.881Z","1.4.0":"2019-09-01T16:50:34.659Z","1.5.0":"2019-09-07T13:14:39.676Z","1.5.1":"2020-04-25T16:08:47.007Z","1.6.0":"2020-07-24T17:44:54.652Z","1.6.1":"2020-12-04T10:46:39.626Z","1.7.0":"2020-12-19T16:28:51.283Z"},"maintainers":[{"name":"andywer","email":"github@andywer.com"}],"description":"PostgreSQL LISTEN &  NOTIFY that finally works.","homepage":"https://github.com/andywer/pg-listen#readme","keywords":["postgres","listen","notify","subscribe","events"],"repository":{"type":"git","url":"git+https://github.com/andywer/pg-listen.git"},"author":{"name":"Andy Wermke","url":"https://github.com/andywer"},"bugs":{"url":"https://github.com/andywer/pg-listen/issues"},"license":"MIT","readme":"<h1 align=\"center\">pg-listen</h1>\n<h3 align=\"center\">Postgres LISTEN & NOTIFY that works</h3>\n\n<p align=\"center\">\n  <a href=\"https://travis-ci.org/andywer/pg-listen\">\n    <img alt=\"Build Status\" src=\"https://travis-ci.org/andywer/pg-listen.svg?branch=master\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/pg-listen\">\n    <img alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/pg-listen.svg\" />\n  </a>\n</p>\n\n<br />\n\nPostgreSQL can act as a message broker: Send notifications with arbitrary payloads from one database client to others.\n\nWorks with node.js 8+ and plain JavaScript or TypeScript 3. Uses the Postgres [`NOTIFY`](https://www.postgresql.org/docs/10/static/sql-notify.html) statement and subscribes to notifications using [`LISTEN`](https://www.postgresql.org/docs/10/static/sql-listen.html).\n\n### Features\n\n&nbsp;&nbsp;&nbsp;&nbsp;📡&nbsp;&nbsp;Send and subscribe to messages\n\n&nbsp;&nbsp;&nbsp;&nbsp;⏳&nbsp;&nbsp;Continuous connection health checks\n\n&nbsp;&nbsp;&nbsp;&nbsp;♻️&nbsp;&nbsp;Reconnects automatically\n\n&nbsp;&nbsp;&nbsp;&nbsp;❗️&nbsp;&nbsp;Proper error handling\n\n&nbsp;&nbsp;&nbsp;&nbsp;👌&nbsp;&nbsp;Type-safe API\n\n---\n\n\n## Installation\n\n```sh\n# using npm:\nnpm install pg-listen\n\n# using yarn:\nyarn add pg-listen\n```\n\n\n## Usage\n\n```js\nimport createSubscriber from \"pg-listen\"\nimport { databaseURL } from \"./config\"\n\n// Accepts the same connection config object that the \"pg\" package would take\nconst subscriber = createSubscriber({ connectionString: databaseURL })\n\nsubscriber.notifications.on(\"my-channel\", (payload) => {\n  // Payload as passed to subscriber.notify() (see below)\n  console.log(\"Received notification in 'my-channel':\", payload)\n})\n\nsubscriber.events.on(\"error\", (error) => {\n  console.error(\"Fatal database connection error:\", error)\n  process.exit(1)\n})\n\nprocess.on(\"exit\", () => {\n  subscriber.close()\n})\n\nexport async function connect () {\n  await subscriber.connect()\n  await subscriber.listenTo(\"my-channel\")\n}\n\nexport async function sendSampleMessage () {\n  await subscriber.notify(\"my-channel\", {\n    greeting: \"Hey, buddy.\",\n    timestamp: Date.now()\n  })\n}\n```\n\n\n## API\n\nFor details see [dist/index.d.ts](./dist/index.d.ts).\n\n\n## Error & event handling\n\n#### `instance.events.on(\"connected\", listener: () => void)`\n\nThe `connected` event is emitted once after initially establishing the connection and later once after every successful reconnect. Reconnects happen automatically when `pg-listen` detects that the connection closed or became unresponsive.\n\n#### `instance.events.on(\"error\", listener: (error: Error) => void)`\n\nAn `error` event is emitted for fatal errors that affect the notification subscription. A standard way of handling those kinds of errors would be to `console.error()`-log the error and terminate the process with a non-zero exit code.\n\nThis `error` event is usually emitted after multiple attempts to reconnect have failed.\n\n#### `instance.events.on(\"notification\", listener: ({ channel, payload }) => void)`\n\nEmitted whenever a notification is received. You must have subscribed to that channel before using `instance.listenTo()` in order to receive notifications.\n\nA more convenient way of subscribing to notifications is the `instance.notifications` event emitter.\n\n#### `instance.events.on(\"reconnect\", listener: (attempt: number) => void)`\n\nEmitted when a connection issue has been detected and an attempt to re-connect to the database is started.\n\n#### `instance.notifications.on(channelName: string, listener: (payload: any) => void)`\n\nThe convenient way of subscribing to notifications. Don't forget to call `.listenTo(channelName)` to subscribe the Postgres client to this channel in order to receive notifications.\n\n\n## Why another package?\n\nIn one sentence: Because none of the existing packages was working reliably in production.\n\nUsing the `NOTIFY` and `LISTEN` features is not trivial using [`node-postgres` (`pg`)](https://www.npmjs.com/package/pg) directly, since you cannot use connection pools and even distinct client connections also tend to time out.\n\nThere are already a few packages out there, like `pg-pubsub`, but neither of them seems to work reliably. Errors are being swallowed, the code is hard to reason about, there is no type-safety, ...\n\nThis package aims to fix those shortcomings. Postgres LISTEN & NOTIFY in node that finally works.\n\n\n## Debugging\n\nSet the `DEBUG` environment variable to `pg-listen:*` to enable debug logging.\n\n\n## License\n\nMIT\n","readmeFilename":"README.md"}