{"name":"scope-lock","version":"1.0.0","author":{"name":"Holepunch Inc."},"license":"Apache-2.0","_id":"scope-lock@1.0.0","homepage":"https://github.com/holepunchto/scope-lock","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"dist":{"shasum":"0b0ac13ce173508caaf6d122a926b095c39e3502","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-1.0.0.tgz","fileCount":4,"integrity":"sha512-fQs4mqeO06l9eQMoImJ4fQuY68dcDVrL5l1fAV406gW3bHzNTglA52PsQR7QHRUO1gfqupLH2wFJDOfsEI+KtA==","signatures":[{"sig":"MEQCIH5ripVXVNlzPgMB6YpYqPUZKkTsv14AdCarrzBmI0x9AiBalzMnYh6stv9ezkXi+3VoJEuTB24emzEpEm6N3EwVtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13603,"size":4951,"noattachment":false,"key":"/scope-lock/-/scope-lock-1.0.0.tgz"},"main":"index.js","gitHead":"dde57dc23ccdf24b8d190616b21515d76141e852","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.0.0_1732306690549_0.8232157984360411","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":1732306690721,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732306690721,"dist-tags":{"latest":"1.2.4"}}