{"_id":"@arwed/signal","_rev":"2-409b2b34c9bf123fca3d696d23a7b5fa","name":"@arwed/signal","description":"A signal to manage asynchronous tasks using coroutines.","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@arwed/signal","version":"0.0.0","keywords":["async","signal"],"author":{"name":"Arwed Mett"},"license":"MIT","_id":"@arwed/signal@0.0.0","maintainers":[{"name":"arwed","email":"arwed.mett@googlemail.com"}],"homepage":"https://github.com/arwed/signal#readme","bugs":{"url":"https://github.com/arwed/signal/issues"},"dist":{"shasum":"6447d396cb6bbf1e725a01f857fdaf0a34a10601","tarball":"https://registry.npmjs.org/@arwed/signal/-/signal-0.0.0.tgz","fileCount":14,"integrity":"sha512-zvkNfj804n1D2K0HWULIgBjR1wJSXtl3lbtUMI1r7kxY5L3kkumOId4080Pm7nxgp+NixAYqdv07dytNpFDEPQ==","signatures":[{"sig":"MEUCIQCZ67/pEF5wIjomy4tMTS5CgWByu6MQBjrjWbqtX4L2ywIgYIRo2uCEWz6eGh0bohzUu0RidzVQAHO/EyV54g5AF1k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6VaaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWQg/+LicMR20jZKI7ci1xODQchs1QLM5KgE39hNWHJiuRoR1jsF2q\r\n7fGXhvVfNtrxmZ3/UBZO5UcoIilQjk5dxO1Msm3kTVu8ymPpPU/7ZMOEFB+E\r\ndYJRPhwm6TtoZpKFHko0JqCBDoc+IKrVv1Qj/noR3mcHN0+xfuhDtNh6JXJs\r\njQRdqBaEEMQgt2N23asVDrhKhcvSquikXlR3LIhYgQS9ATZBorb/DmLgy2Bn\r\npiRxknDoxSAAUQjD56YiIHlgDFaRXzg32BWtqS1KeJz40z0jlBIc8xMygY96\r\nG4zusqMGaliUvDwdISx+mvBJp3Uv5oFeFs8txH/wGUlYHg0jbxQTQuaIggFy\r\nqkkz3WEAPQ6w3r/df/2fPlYs3yWj7LtqoJOpy8PcV2AH0/eBtw83JZHjfu+b\r\nvGWllNzy2gVZG4BYAVgJ86/vwtxqBwXQgL1eBvwIIB+rgxO0ZjG9vc0e12A3\r\nZfEyXLh/oxg6qGO+mxtjBbYXYrqRqpcKVgo3kU0RcUv4D8uOLdOKFeU/9K8Y\r\nBB88uZqQ3xZ2HnNIW0/iSLA+7Tv2x2jZmvOvmcBeWtlBEzYWslvtRd3R7Zl/\r\nRKad6ihwqUaLb86OEZ3dXJqIfbHoRl2eMaysKpz36rfclPArlbzxpv24SIId\r\nWdcxdc2VyjbN/PQUqAwEW5apkRcxiofTd50=\r\n=hT47\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","types":"./build/index.d.ts","gitHead":"44e098242989fb269cb422a367df1a19771619a8","scripts":{"test":"npm run test:lint && npm run test:unit","build":"npm run build:production","clean":"rm -rf build","start":"npm run build:development -- --watch","analyze":"cross-env TS_NODE_PROJECT=\"webpack.tsconfig.json\" npx webpack --config webpack/analyze.ts","prepack":"npm run build:production","test:lint":"npx eslint src/**/*.ts test/**/*.ts","test:unit":"npx mocha --require ts-node/register --extension ts","build:production":"npm run clean && cross-env TS_NODE_PROJECT=\"webpack.tsconfig.json\" npx webpack --config webpack/production.ts","build:development":"cross-env TS_NODE_PROJECT=\"webpack.tsconfig.json\" npx webpack --config webpack/development.ts"},"_npmUser":{"name":"arwed","email":"arwed.mett@googlemail.com"},"repository":{"url":"git+ssh://git@github.com/arwed/signal.git","type":"git"},"_npmVersion":"8.1.3","description":"A signal to manage asynchronous tasks using coroutines.","directories":{},"_nodeVersion":"16.14.2","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^10.0.0","eslint":"^8.21.0","ts-node":"^10.9.1","webpack":"^5.37.0","cross-env":"^7.0.3","ts-loader":"^9.1.2","typescript":"^4.2.4","@types/chai":"^4.2.18","@types/node":"^18.6.3","webpack-cli":"^4.7.0","@types/mocha":"^9.1.1","@types/webpack":"^5.28.0","webpack-bundle-analyzer":"^4.4.1","@typescript-eslint/parser":"^5.32.0","@types/webpack-bundle-analyzer":"^4.4.0","@typescript-eslint/eslint-plugin":"^5.32.0"},"_npmOperationalInternal":{"tmp":"tmp/signal_0.0.0_1659459226608_0.16648025372529474","host":"s3://npm-registry-packages"}},"0.0.1":{"name":"@arwed/signal","version":"0.0.1","keywords":["async","signal"],"author":{"name":"Arwed Mett"},"license":"MIT","_id":"@arwed/signal@0.0.1","maintainers":[{"name":"arwed","email":"arwed.mett@googlemail.com"}],"homepage":"https://github.com/arwed/signal#readme","bugs":{"url":"https://github.com/arwed/signal/issues"},"dist":{"shasum":"ef4063234900b1782ca69271b31fbfc5f0758fbb","tarball":"https://registry.npmjs.org/@arwed/signal/-/signal-0.0.1.tgz","fileCount":19,"integrity":"sha512-muSJCrJj9ZD5hV1dREHZ3FtCAcMdTiS3S/4laMDCgkLedzllkHBJZSWYoKYQlV6BshwhVrl63TSXLw6mX3U4Vw==","signatures":[{"sig":"MEUCIH4WW6yOt8sTU58Y4UQqsR9A8dN2fAR0tAeeamA0ZaHXAiEA2Naochb0v0tG2fS09IlxDANWUHVP+7HHNHXO9WB3Nek=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrhb0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsPBAAm4cPKq5HeVBWMpbySFh6NECzI8eKcshOvykBKNI8ggRsDYRC\r\n72PeRXr4pydeyt56V+Fd5u+oOLE7zjMU5QI5zqd2h/xQSwvVKmpnnexF5dLW\r\n7HW2QK6zKQb+dyv6EVwov7WcdKhcy6TUnMnqL01dzkYnsYSX45P5uMTuUGwh\r\nuqVbUldLWxd93wYqw03kiRO9c1AJiXz6lXhO675PqALjvP71lEGjILbyD3Iq\r\nxtqiw+4CId+boWHKOwz5GOZBLyuu1EACLCAeNtJJcStYCVHQ2iOMBKBdlanT\r\nIbpZ4lC578qTiFeJZmEDp7tBbCHo3cyahET25JOvOb4LEJ/OizM+EUJTbrV6\r\nnNRmPX852Tif4rNFEzMRENj3OK04171f3uL+H+KBjl1tXkIjCmQD7hYLAL04\r\nh0QX6uyodWHaxO5OSWso5RAWUJ7mrDvRWUPdnD9ugkTpxgFOZDWpWBVl2k3a\r\nKyP3h0PoSRuPDrAeykuNPKr5KLYPxiwIeX44Md9ofoRpTHD6vFqb4neC8L69\r\n8hGsRCvN5t73SLiSZhrZC+8toZz2hmWbLmTzPNGUFMJ3vAhWa5UdiYjf7OwC\r\n2JF6QAbBy2XChqkcJoT6NOaWY+4dto7XhRDipqlM4JwXsxdWtQgdiBezsFh2\r\nhpTZms09hNmsnmqrc0aWW0IrkrMOWNxnL48=\r\n=bGBR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/index.js","type":"module","types":"./build/index.d.ts","gitHead":"a6be6268c68c670dd2f490c0c83956dd5da49cfb","scripts":{"test":"npm run test:lint && npm run test:unit","build":"npx tsc","clean":"rm -rf build","prepack":"npm run clean && npm run build","test:lint":"npx eslint src test","test:unit":"npx mocha"},"_npmUser":{"name":"arwed","email":"arwed.mett@googlemail.com"},"repository":{"url":"git+ssh://git@github.com/arwed/signal.git","type":"git"},"_npmVersion":"9.1.2","description":"A signal to manage asynchronous tasks using coroutines.","directories":{},"_nodeVersion":"18.12.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0","eslint":"^8.30.0","ts-node":"^10.9.1","typescript":"^4.9.4","@types/chai":"^4.3.4","@types/node":"^18.11.18","@types/mocha":"^10.0.1","@typescript-eslint/parser":"^5.47.1","@typescript-eslint/eslint-plugin":"^5.47.1"},"_npmOperationalInternal":{"tmp":"tmp/signal_0.0.1_1672353524528_0.6763287314666533","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@arwed/signal","version":"0.0.2","description":"A signal to manage asynchronous tasks using coroutines.","main":"build/cjs/index.js","module":"build/esm/index.js","repository":{"type":"git","url":"git@gitea.metthub.de:3001/Pfeifenjoy/signal.git"},"scripts":{"build:cjs":"npx tsc --project tsconfig.cjs.json","build:esm":"npx tsc --project tsconfig.esm.json","build":"npm run build:cjs && npm run build:esm","clean":"rm -rf build","test":"npm run test:lint && npm run test:unit","test:lint":"npx eslint src test","test:unit":"npx jest","prepack":"npm run clean && npm run build"},"keywords":["async","signal"],"author":{"name":"Arwed Mett"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.12","@types/node":"^20.13.0","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","eslint":"^8.30.0","jest":"^29.7.0","ts-jest":"^29.1.4","ts-node":"^10.9.1","typescript":"^5.4.5"},"types":"./build/cjs/index.d.ts","gitHead":"f8abe05a408c5a5fa0c358a477c22cfbc9348dc8","_id":"@arwed/signal@0.0.2","_nodeVersion":"18.12.1","_npmVersion":"9.1.2","dist":{"integrity":"sha512-BfEermk2OPtshV4Bh16jCTOTGXCfkbwfSEknjmt11Pz9+dDSmWJwJ1eudERLzhNxW4dtBsuOjpPBc1+ZqHAskw==","shasum":"f29db3adc0442a856b70a14b40f32735d4acf586","tarball":"https://registry.npmjs.org/@arwed/signal/-/signal-0.0.2.tgz","fileCount":59,"unpackedSize":150599,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBs9Q4iBqAmPcFXr/MAbCUkiMYPb2ZeAe2YZzUqmyzYsAiEA9Q4UyphbyVTVQFdaFI/bFYmgI98FRJFAD1QwK6JgQZY="}]},"_npmUser":{"name":"arwed","email":"arwed.mett@googlemail.com"},"directories":{},"maintainers":[{"name":"arwed","email":"arwed.mett@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signal_0.0.2_1717258819038_0.20674194234206644"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-02T16:53:46.545Z","modified":"2024-06-01T16:20:19.400Z","0.0.0":"2022-08-02T16:53:46.778Z","0.0.1":"2022-12-29T22:38:44.688Z","0.0.2":"2024-06-01T16:20:19.223Z"},"maintainers":[{"name":"arwed","email":"arwed.mett@googlemail.com"}],"author":{"name":"Arwed Mett"},"repository":{"type":"git","url":"git@gitea.metthub.de:3001/Pfeifenjoy/signal.git"},"keywords":["async","signal"],"license":"MIT","readme":"# Signal\n\n[![Build Status](https://drone.metthub.de/api/badges/Pfeifenjoy/signal/status.svg)](https://drone.metthub.de/Pfeifenjoy/signal)\n\nA small library to manage asynchronous tasks using coroutines.\n\n## Usage\n\n```\nnpm i --save @arwed/signal\n```\n\n## Example\n\nA signal lets you wait at a certain position of your code until the notify method is called.\n\n```js\nimport Signal from \"@arwed/signal\"\n\n(async () => {\n\tconst signal = new Signal\n\n\t//call signal in 1s\n\tsetTimeout(() => signal.notify(), 1000)\n\n\t//wait until notify is called\n\tawait signal.wait()\n})()\n```\n\nThis can be used to send a cancel signal to a running loop.\n\nE.g. Let a loop run for 1s.\n```js\nimport Signal from \"@arwed/signal\"\n\n(async () => {\n\tconst signal = new Signal\n\n\t//notify the signal after 1s\n\tsetTimeout(() => signal.notify(), 1000)\n\n\tawait signal.repeat(async (cancel: Signal) => {\n\t\t//repeat this function until the signal is notified\n\t})\n})()\n```\n\nYou can also make this dependent on a shutdown event.\n","readmeFilename":"README.md"}