{"_id":"synchd","_rev":"9-c7d15b39d0ead1260c7512f91277fd76","name":"synchd","description":"Make guarded sections of code that won't run concurrently and queue instead","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"synchd","version":"0.1.0","description":"Make guarded sections of code that won't run concurrently and queue instead","main":"js/index.js","scripts":{"prepublish":"babel -s inline -d js/ src/ && flow-copy-source -v src js","test":"npm run lint && npm run flow_check && mocha","flow_check":"flow check","lint":"eslint .","lint-fix":"eslint . --fix"},"repository":{"type":"git","url":"git+https://github.com/AgentME/synchronized-promise.git"},"keywords":["mutex","asynchronous","queue","promise"],"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/AgentME/synchronized-promise/issues"},"homepage":"https://github.com/AgentME/synchronized-promise#readme","dependencies":{"babel-runtime":"^6.11.6"},"devDependencies":{"babel-cli":"^6.14.0","babel-eslint":"^6.1.2","babel-plugin-transform-class-properties":"^6.11.5","babel-plugin-transform-flow-strip-types":"^6.14.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-es2015":"^6.14.0","babel-register":"^6.14.0","eslint":"^3.5.0","flow-bin":"^0.32.0","flow-copy-source":"^1.1.0","mocha":"^3.0.2","pdelay":"^1.0.0","semver":"^5.3.0","sinon":"^1.17.5"},"gitHead":"fe4015ae8d1249da2608154d78329f9d1ad6337f","_id":"synchd@0.1.0","_shasum":"1ce7641a3531a0257e76981fae96f6a50efb1b5b","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"agentme","email":"agentme49@gmail.com"},"dist":{"shasum":"1ce7641a3531a0257e76981fae96f6a50efb1b5b","tarball":"https://registry.npmjs.org/synchd/-/synchd-0.1.0.tgz","integrity":"sha512-tISsYTL8qJpSMBc57g1FzZTKS5/aWenLLG8HTpGZfoyPF/XPWvIl6wlKfU/BDiO169C1y5FCBsF+WgOeQvBI0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/SGvLU8nFH87EgLqJPEdH9yLm/AKSEZ+EMYL6D4EudAiEAi7dUPVIi3431kodwEEfOQ7aCR5BrH8eD98mIsrpghlU="}]},"maintainers":[{"name":"agentme","email":"agentme49@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/synchd-0.1.0.tgz_1474064056260_0.4503860310651362"},"directories":{}},"1.0.0":{"name":"synchd","version":"1.0.0","description":"Make guarded sections of code that won't run concurrently and queue instead","main":"js/index.js","scripts":{"prepublish":"babel -s inline -d js/ src/ && flow-copy-source -v src js","test":"npm run lint && npm run flow_check && mocha","flow_check":"flow check","lint":"eslint .","lint-fix":"eslint . --fix"},"repository":{"type":"git","url":"git+https://github.com/AgentME/synchronized-promise.git"},"keywords":["mutex","asynchronous","queue","promise"],"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/AgentME/synchronized-promise/issues"},"homepage":"https://github.com/AgentME/synchronized-promise#readme","dependencies":{"babel-runtime":"^6.11.6"},"devDependencies":{"babel-cli":"^6.14.0","babel-eslint":"^6.1.2","babel-plugin-transform-class-properties":"^6.11.5","babel-plugin-transform-flow-strip-types":"^6.14.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-es2015":"^6.14.0","babel-register":"^6.14.0","eslint":"^3.5.0","flow-bin":"^0.32.0","flow-copy-source":"^1.1.0","mocha":"^3.0.2","pdelay":"^1.0.0","semver":"^5.3.0","sinon":"^1.17.5"},"gitHead":"37be3f01f083070d2f088a3229e7cc4949044cb2","_id":"synchd@1.0.0","_shasum":"9b8e5b952366a8b797a2e5dd15d3be39f884c82a","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"agentme","email":"agentme49@gmail.com"},"dist":{"shasum":"9b8e5b952366a8b797a2e5dd15d3be39f884c82a","tarball":"https://registry.npmjs.org/synchd/-/synchd-1.0.0.tgz","integrity":"sha512-T1skhPti2uWhCI4IeiuQd1yTRrB6zcaDSW/2l5UmKIE9d/bFIylsd4bAlNFYyra9R7ZApUqMJlTjc4MO10v/Ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGzH086NIeeMXztfHMvsLR1AScY/uSw2K0bvay7m6TpeAiA39cMPb1Cx7NxT80RN6P821kRIZqNLaAL4ppUXW2ZdPA=="}]},"maintainers":[{"name":"agentme","email":"agentme49@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/synchd-1.0.0.tgz_1474064503178_0.9573410225566477"},"directories":{}},"1.0.1":{"name":"synchd","version":"1.0.1","description":"Make guarded sections of code that won't run concurrently and queue instead","main":"js/index.js","scripts":{"prepublish":"babel -s inline -d js/ src/ && flow-copy-source -v src js","test":"npm run lint && npm run flow_check && mocha","flow_check":"flow check","lint":"eslint .","lint-fix":"eslint . --fix"},"repository":{"type":"git","url":"git+https://github.com/AgentME/synchronized-promise.git"},"keywords":["mutex","asynchronous","queue","promise"],"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/AgentME/synchronized-promise/issues"},"homepage":"https://github.com/AgentME/synchronized-promise#readme","dependencies":{"babel-runtime":"^6.11.6"},"devDependencies":{"babel-cli":"^6.14.0","babel-eslint":"^6.1.2","babel-plugin-transform-class-properties":"^6.11.5","babel-plugin-transform-flow-strip-types":"^6.14.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-es2015":"^6.14.0","babel-register":"^6.14.0","eslint":"^3.5.0","flow-bin":"^0.32.0","flow-copy-source":"^1.1.0","mocha":"^3.0.2","pdelay":"^1.0.0","semver":"^5.3.0","sinon":"^1.17.5"},"gitHead":"623ff981750ecc59e4d65f3643a4d7d4db18bfb1","_id":"synchd@1.0.1","_shasum":"b2a0f34d38287e12fe9558273f118ef8dee4102b","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"agentme","email":"agentme49@gmail.com"},"dist":{"shasum":"b2a0f34d38287e12fe9558273f118ef8dee4102b","tarball":"https://registry.npmjs.org/synchd/-/synchd-1.0.1.tgz","integrity":"sha512-0G3MYwvV92TYGQ70QmpSzTdO3ZqkLSjEgdhl/u60NrKXE0dyXCj7H4JRZ8nw9ZtVuKN2JExUsuWgiv1jg89pDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIbGO5Y6GmpB8YJZP9xKrsSFlXnM1S88dHGbRJAwke9AiAnHf6R142RxagA5JlluFaVXQasheh4vVhYdM6CXWYUdg=="}]},"maintainers":[{"name":"agentme","email":"agentme49@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/synchd-1.0.1.tgz_1474065461472_0.999344770796597"},"directories":{}},"1.0.2":{"name":"synchd","version":"1.0.2","description":"Make guarded sections of code that won't run concurrently and queue instead","main":"js/index.js","scripts":{"prepublish":"babel -s inline -d js/ src/ && flow-copy-source -v src js","test":"npm run lint && npm run flow_check && mocha","flow_check":"flow check","lint":"eslint .","lint-fix":"eslint . --fix"},"repository":{"type":"git","url":"git+https://github.com/AgentME/synchd.git"},"keywords":["mutex","asynchronous","queue","promise"],"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/AgentME/synchd/issues"},"homepage":"https://github.com/AgentME/synchd#readme","dependencies":{"babel-runtime":"^6.11.6"},"devDependencies":{"babel-cli":"^6.14.0","babel-eslint":"^6.1.2","babel-plugin-transform-class-properties":"^6.11.5","babel-plugin-transform-flow-strip-types":"^6.14.0","babel-plugin-transform-runtime":"^6.15.0","babel-preset-es2015":"^6.14.0","babel-register":"^6.14.0","eslint":"^3.5.0","flow-bin":"^0.32.0","flow-copy-source":"^1.1.0","mocha":"^3.0.2","pdelay":"^1.0.0","semver":"^5.3.0","sinon":"^1.17.5"},"gitHead":"637d4296de7f16d6913ce6c5bef66f4690bd38fc","_id":"synchd@1.0.2","_shasum":"537962907e79e2d1007d9968e46f435a63c1d58e","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"agentme","email":"agentme49@gmail.com"},"dist":{"shasum":"537962907e79e2d1007d9968e46f435a63c1d58e","tarball":"https://registry.npmjs.org/synchd/-/synchd-1.0.2.tgz","integrity":"sha512-RarVdCgn5N7sGD14Hbp5IPi+tMb2B6y4kIR9midt7ChsXtZOvaYbdsw7W2SSeCGdEIVcpO6LEgDCziZhlNYYFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvojvPY++pPlNEVBgUioRNHvaNuBvJg3EjszykLy6tPAiBk/WZYF2UyCbNNeDDgE+kG7vV4AVNJXPb2AMIGnz0vkQ=="}]},"maintainers":[{"name":"agentme","email":"agentme49@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/synchd-1.0.2.tgz_1474067923840_0.17731118598021567"},"directories":{}},"1.1.0":{"name":"synchd","version":"1.1.0","description":"Make guarded sections of code that won't run concurrently and queue instead","main":"js/index.js","sideEffects":false,"scripts":{"prepare":"babel -s inline -d js/ src/ && flow-copy-source -v src js","test":"yarn run lint && flow check && mocha && tsc","lint":"eslint .","lint-fix":"eslint . --fix"},"repository":{"type":"git","url":"git+https://github.com/Macil/synchd.git"},"keywords":["mutex","asynchronous","queue","promise"],"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/Macil/synchd/issues"},"homepage":"https://github.com/Macil/synchd#readme","dependencies":{"@babel/runtime":"^7.0.0"},"devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/register":"^7.0.0","babel-eslint":"^10.0.0","eslint":"^5.0.0","flow-bin":"^0.81.0","flow-copy-source":"^2.0.0","mocha":"^5.2.0","pdelay":"^2.0.0","semver":"^5.3.0","sinon":"^6.0.0","typescript":"^3.0.3"},"gitHead":"8100b704c978342c65adb3be8dc48b79fafc9c9a","_id":"synchd@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"agentme","email":"agentme49+oldnpm@gmail.com"},"dist":{"integrity":"sha512-h/OTD8LKM98BvKDIJ2yeTC3ZuOAQM062KCY+dGJ1B7vDsURROREDLbldAQtqjZwN203tuOEI9+C90OalGCf5zA==","shasum":"b31933c412fcb1af49ecc1e5b36f32b17a48907b","tarball":"https://registry.npmjs.org/synchd/-/synchd-1.1.0.tgz","fileCount":12,"unpackedSize":11040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqyRlCRA9TVsSAnZWagAAZy0QAIBf0vEWQuOWPzmQVjkK\n2k2uhj33DdoYiFo/t17LVmoN32Ea50+3dKyvalWX3LXvvYy/k67uy+9tgV7Y\nenqt99PCdtuGtKE0kOB2JMhmeg11zYXlpKJV7DMSsQI5/+0TDRD/vymvPvz2\nEKQj2FncLM8heQe4LdPU675ABrZwE6tb8lIT9mK7mAY8yH/YPIy+bg5ZeVbW\ndViNm4wN2q3FwBPvmQktcxBYc3lh9wAJ7WOFEnF7BeN76D5JotrFcQ8Irx1/\nb7dAeMp0kSbQlwUp2EtNBKJPSx7qocrkUGmUVCQTi190+H1OQkO1rb7eBEg0\n+rDNwwUNgtX1eDuEAAsWk/ebDue06GEqBd0DHpt5bmGjM439aq0EZ9lV+LC2\nJaINuLbp55M0XAnNPe2l4xStZwG7kjzoB90dhVkZsgqNdCf4jq0DkxQdFw3P\nb1sZmT3LSSfNgBQQsqdeScjahbtRot0gT1R5cwX+QBzWa8fdhynhBDfSkQhI\nTwAR46GRVlNx9yvKQVafvqCUvvKmWkY8+u042YyUHucXqlblBHTB8fNsMRRh\nZVwS3fBwo4668tqHNFKsaFlz8aP9sFSHUMmiWSg2aib6FFl6hS/jkAHp7ANp\npcvjjv+X2w1D9ewUdF+YHztowa+VKhRCnH5m/v/UZSOv78OKBuT0njn8mqSV\n7nYI\r\n=hJko\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAC+NZh6EQbBNOStDkFJsuRV/JRBPc2aG/XIeCaBtYq8AiEA38K3xf5JPTm0XWdM0X+kcAUXqk8ol8vI0EOzA5SPnNY="}]},"maintainers":[{"name":"agentme","email":"agentme49@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/synchd_1.1.0_1537942628804_0.6102617557322891"},"_hasShrinkwrap":false}},"readme":"# synchd\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Macil/synchd/blob/master/LICENSE.txt) [![npm version](https://img.shields.io/npm/v/synchd.svg?style=flat)](https://www.npmjs.com/package/synchd) [![CircleCI Status](https://circleci.com/gh/Macil/synchd.svg?style=shield)](https://circleci.com/gh/Macil/synchd) [![Greenkeeper badge](https://badges.greenkeeper.io/Macil/synchd.svg)](https://greenkeeper.io/)\n\nThis module allows guarded sections of code to be made that execute exclusively\nin the order they're called.\n\nSimilar to [node-synchronized](https://github.com/jupiter/node-synchronized),\nbut uses Promises and includes Flow type declarations.\n\n## API\n\nThis project exports the `synchd` and `synchdFn` functions. If you're using an\nES6 compiler, you can access them like this:\n\n```js\nimport {synchd, synchdFn} from 'synchd';\n```\n\nOr you can access the functions through the classic CommonJS style:\n\n```js\nvar synchd = require('synchd');\n// synchd.synchd(...)\n// synchd.synchdFn(...)\n```\n\n### synchd(scopeKey, fn)\n\n`scopeKey` may be any object and it's used as the lock. No other synchd calls\nwith the same scopeKey given will be run at the same time; they will be queued\nin-order to run after. `fn` is a function which takes no arguments and must\nreturn a Promise.\n\nThis call returns a Promise that resolves to the same value that the Promise\nreturned by `fn` resolves to.\n\n### synchdFn(scopeKey, fn)\n\nThis is a convenience function for creating functions that are entirely wrapped\nin a synchd call with a single scopeKey.\n\n`scopeKey` has the same meaning as above. `fn` is a function that may take\narguments and must return a Promise.\n\nThis call returns a function with the same signature as `fn`. All arguments\npassed to the function will be passed on to `fn` when it gets executed, and the\nreturned Promise will resolve to the value of the Promise that `fn` returns.\n\nHere's an example of defining a single function which can't be running multiple\ntimes concurrently. This example assumes you're using a compiler which supports\nasync/await.\n\n```js\nimport {synchdFn} from 'synchd';\nimport delay from 'pdelay';\n\nconst exclusiveFunction = synchdFn({}, async (x) => {\n  console.log(`exclusiveFunction(${x}) started`);\n  await delay(100);\n  console.log(`exclusiveFunction(${x}) ending`);\n  return x+1;\n});\n\nexclusiveFunction(5);\nexclusiveFunction(6);\n\n// The following will be printed:\n// exclusiveFunction(5) started\n// exclusiveFunction(5) ending\n// exclusiveFunction(6) started\n// exclusiveFunction(6) ending\n```\n\n## Types\n\nBoth [TypeScript](https://www.typescriptlang.org/) and\n[Flow](https://flowtype.org/) type definitions for this module are included!\nThe type definitions won't require any configuration to use.\n","maintainers":[{"email":"agentme49@gmail.com","name":"macil"}],"time":{"modified":"2022-06-27T03:12:23.979Z","created":"2016-09-16T22:14:19.095Z","0.1.0":"2016-09-16T22:14:19.095Z","1.0.0":"2016-09-16T22:21:43.436Z","1.0.1":"2016-09-16T22:37:46.444Z","1.0.2":"2016-09-16T23:18:44.095Z","1.1.0":"2018-09-26T06:17:08.978Z"},"homepage":"https://github.com/Macil/synchd#readme","keywords":["mutex","asynchronous","queue","promise"],"repository":{"type":"git","url":"git+https://github.com/Macil/synchd.git"},"author":{"name":"Chris Cowan","email":"agentme49@gmail.com"},"bugs":{"url":"https://github.com/Macil/synchd/issues"},"license":"MIT","readmeFilename":"README.md"}