{"name":"scope-lock","version":"1.2.4","description":"Some concurrency semantics around entering scopes","main":"index.js","devDependencies":{"brittle":"^3.7.0","standard":"^17.1.2"},"scripts":{"test":"standard && brittle test.js"},"repository":{"type":"git","url":"git+https://github.com/holepunchto/scope-lock.git"},"author":{"name":"Holepunch Inc."},"license":"Apache-2.0","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"homepage":"https://github.com/holepunchto/scope-lock","_id":"scope-lock@1.2.4","gitHead":"4864a69efdc4443eed19680b19b5c7d6441bf442","_nodeVersion":"20.11.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-BpSd8VCuCxW9ZitcdIC/vjs3gMaP9bRBL5nkHcyfX2VrS52n13/rHuBA2xJ/S/4DPuRdAO/Bk8pWd8eD/gHCIA==","shasum":"eac350c3dd8b6465d24a022697188fc13a2ad0bc","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-1.2.4.tgz","fileCount":4,"unpackedSize":14332,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwJLk/zU6+NMryqaMeN1VDCIHuyP62w0OkDLpyeAipawIgNuXVtdTh93ch8QEem+Hz8maEtE02C+hoY8/TBSAMRZk="}],"size":5058,"noattachment":false,"key":"/scope-lock/-/scope-lock-1.2.4.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scope-lock_1.2.4_1732613717337_0.09719978554585151"},"_hasShrinkwrap":false,"readme":"# scope-lock\n\nSome concurrency semantics around entering scopes\n\n```\nnpm install scope-lock\n```\n\n## Usage\n\n``` js\nconst ScopeLock = require('scope-lock')\n\n// normal lock runs all entries in the lock list\nconst l = new ScopeLock()\n\nawait l.lock()\n// ... do your thing\nl.unlock()\n\n// debounced lock runs first and last entry in the lock list\nconst d = new ScopeLock({ debounce: true }) // debounced lock\n\nif (await d.lock()) {\n  // if we get lock do our thing\n}\n\n// wait for all current work to drain\nawait d.flush()\n```\n\n## License\n\nApache-2.0\n","publish_time":1732613717512,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732613717512,"dist-tags":{"latest":"1.2.4"}}