{"_id":"@bumblehead/promisemutex","_rev":"1-16bf5dbed29c3a024af77f3c262d9be0","name":"@bumblehead/promisemutex","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@bumblehead/promisemutex","version":"0.0.1","license":"MIT","description":"promises added to the mutex are handled sequentially","author":{"name":"Chris","email":"chris@bumblehead.com"},"main":"promisemutex.js","module":"promisemutex.js","repository":{"type":"git","url":"git+https://github.com/iambumblehead/promisemutex.git"},"keywords":["promisemutex"],"devDependencies":{"ava":"^3.15.0","esm":"^3.2.25","eslint":"^7.17.0","babel-eslint":"^10.1.0"},"ava":{"timeout":"2m","require":["esm"]},"scripts":{"test":"npm run lint && ava","lint":"eslint *js"},"gitHead":"d655d8f2431bab48d219a892e3dd7d7c83f17bef","bugs":{"url":"https://github.com/iambumblehead/promisemutex/issues"},"homepage":"https://github.com/iambumblehead/promisemutex#readme","_id":"@bumblehead/promisemutex@0.0.1","_nodeVersion":"15.6.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-AngeT0adhh/ANbiEa7jUxaUK7u+VlF3vEis+ZOVEPGG8Qf6OkljYW+psp1pLYuLQ+rGy64R2X4u1rSozkAK7Pw==","shasum":"883cb315a60efb4aaac7ec6f64b23eff6144a127","tarball":"https://registry.npmjs.org/@bumblehead/promisemutex/-/promisemutex-0.0.1.tgz","fileCount":4,"unpackedSize":3614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBNzTCRA9TVsSAnZWagAAb0wP/2H+CSy/ZDqKnSgEhXOk\n8p8OxN6VMog+I1mvxBQmXZnePJIOHAS9l6CZVrO6v8cIvEMyTXWOkCIFidau\nqsKdTnNNxcGyLPYql1HrynbmJj2qd73Ch0QLopjj8g34rAe6vDWRD8LU9+iP\nvH/C0sQnlIEIuHlQ63y3uNJY6LJi5IwHL8mnO6dKalJYoEiZW1HZlVbLUgwF\n+qq+dYVJWv8jz79cR3pDk3LSoaC/TtQnvF8kkuSoUfvRibkEZ+vN7HNsc4XF\nye7Q3sMIWN4x1VK6KnIblA6cO5iAlzlxo4z+pZ5Yasa9gYJvgXsKfRkVbCBD\nV0UY5GUgzLMvh3iUvk0oQGFi0/h34GXsuch73AeYJujJANterrPhh9vzC4be\nm83sjSghx1JvS7E2auulq0uSTM7Sv6n1FzzVgAcBqmotGEEZ3q84QbIcwAqs\nr4J18JofOJpwljAmt7A457J3bOGrnOH6nYMZycAI3/8+XlM2Y+bt8/AtxDRE\nTFRWNbJwYjhTYUyY0ZhB5aKu/dNZPUmCCOOTL5bpBbHgWp9StehF3sjuGmrA\nxLESdeKxvNehbLcjjNwWysLJKCnQJMIhd4pXQuphSuLNmU90FD8u2ZbJ/OEu\nm9Jym+WB/KKnqM3T2wz0x3O4CjdL7W6asau4P1jpxfgSAAIdJgqicXrvZuYi\ntss3\r\n=vYlC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBGbw/hkZRvDRLYw3hlHe6ktiAtYjohP70ifhQqMqvfgIgdYEh/WxW73a8KRElsx48lGIgJWULoIkzSkIi1EJhSY0="}]},"_npmUser":{"name":"bumblehead","email":"chris@bumblehead.com"},"directories":{},"maintainers":[{"name":"bumblehead","email":"chris@bumblehead.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promisemutex_0.0.1_1610931410923_0.4104052417902251"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-18T00:56:50.888Z","0.0.1":"2021-01-18T00:56:51.301Z","modified":"2022-04-04T21:04:58.745Z"},"maintainers":[{"name":"bumblehead","email":"chris@bumblehead.com"}],"description":"promises added to the mutex are handled sequentially","homepage":"https://github.com/iambumblehead/promisemutex#readme","keywords":["promisemutex"],"repository":{"type":"git","url":"git+https://github.com/iambumblehead/promisemutex.git"},"author":{"name":"Chris","email":"chris@bumblehead.com"},"bugs":{"url":"https://github.com/iambumblehead/promisemutex/issues"},"license":"MIT","readme":"promisemutex\n============\n**(c)[Bumblehead][0]**\n\n[![Build Status](https://travis-ci.org/iambumblehead/promisemutex.svg?branch=master)](https://travis-ci.org/iambumblehead/promisemutex)\n\nPromises added to the mutex are handled sequentially.\n\n``` javascript\nimport promisemutex from 'promisemutex';\n\nconst mutex = promisemutex();\n\nawait Promise.all([\n  mutex(async () => {\n    await resolveAfterSeconds(4);\n    state.firstPromiseEnded = Date.now();\n  }),\n  mutex(async () => {\n    state.secondPromiseStarted = Date.now() + 1;\n    await resolveAfterSeconds(1);\n  })\n]);\n```\n\nIn the example, the second async function is called only after the first async function completes. This is useful in rare cases where async functions must be processed sequentially within concurrent stacks.\n\n\n\n[0]: http://www.bumblehead.com \"bumblehead\"\n","readmeFilename":"README.md"}