{"name":"scope-lock","version":"1.2.1","author":{"name":"Holepunch Inc."},"license":"Apache-2.0","_id":"scope-lock@1.2.1","homepage":"https://github.com/holepunchto/scope-lock","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"dist":{"shasum":"e4e37f24a9009119d7cd61a62c5f510cf5a1c74a","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-1.2.1.tgz","fileCount":4,"integrity":"sha512-rLqbl2ulV26YtBSV0zrS6jWNPcwA0a4EbRa+z2gHHXDHoqyZTce2CYQZ4HLaly30fhEqEYFyj2hito8nNqHtvg==","signatures":[{"sig":"MEUCIQCln8jkQwXwJbwAJ8zcJW7TjpiWRa1x0Gm8tCQdopvFkQIgVCt2lGasYI+t4aeBy0wMW3FWV7q0JZ59m2Rx2ENFdN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14089,"size":4994,"noattachment":false,"key":"/scope-lock/-/scope-lock-1.2.1.tgz"},"main":"index.js","gitHead":"ecc1ae3d9a382323a6a111cccde6130513271c19","scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/holepunchto/scope-lock.git","type":"git"},"_npmVersion":"10.7.0","description":"Some concurrency semantics around entering scopes","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"brittle":"^3.7.0","standard":"^17.1.2"},"_npmOperationalInternal":{"tmp":"tmp/scope-lock_1.2.1_1732528733622_0.8428351784588604","host":"s3://npm-registry-packages"},"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":1732528733757,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732528733757,"dist-tags":{"latest":"1.2.4"}}