{"name":"scope-lock","version":"1.2.3","author":{"name":"Holepunch Inc."},"license":"Apache-2.0","_id":"scope-lock@1.2.3","homepage":"https://github.com/holepunchto/scope-lock","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"dist":{"shasum":"226906eac572376948bbbbed982b4b0441bdfe00","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-1.2.3.tgz","fileCount":4,"integrity":"sha512-Q+PqcbJCq6ew9xb0PoYoE6hHUwTPQOVt2LOFjVcDJ81uvyMWlZ6l0/h6NVGnx4ZCxuWI2MeXJYBhNwPVYmJMWA==","signatures":[{"sig":"MEYCIQDlo8D1Beue6Q6soT6lQMJZP1dy2l6ACg1vaurOBSLw9AIhAPO/D9P4EfLLu3WGL05QGXp2ZcGnTo4Bb3Y+9PUxUVYi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14312,"size":5056,"noattachment":false,"key":"/scope-lock/-/scope-lock-1.2.3.tgz"},"main":"index.js","gitHead":"61cc5b9b54fb6ef18620329aecefc521091393bf","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.3_1732613075495_0.06915821669514322","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":1732613075690,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732613075690,"dist-tags":{"latest":"1.2.4"}}