{"name":"scope-lock","version":"0.0.0","author":{"name":"Holepunch Inc."},"license":"Apache-2.0","_id":"scope-lock@0.0.0","homepage":"https://github.com/holepunchto/scope-lock","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"dist":{"shasum":"32e7f76b8359ecba2ee722ee68bf95294bb0c9f3","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-0.0.0.tgz","fileCount":4,"integrity":"sha512-X+PMR52R0YQoIXGR8/Vj1di7IKtjB4Lc0a72SGgLOaPLHEROaSa51jYtMRwGeYSnsTqBtDYmQZzohxk2HeaOAg==","signatures":[{"sig":"MEQCIG2ijlZV5yVUWRPt94oJfFfKQz6l0rA9/7/ysHAMhlsvAiA6nzj2UjHXnmJS8iiNuIeIsDKBNOLCJIDuo34B6JRw7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13603,"size":4950,"noattachment":false,"key":"/scope-lock/-/scope-lock-0.0.0.tgz"},"main":"index.js","gitHead":"3e1a9e3faf47ec56498af35a7cacc38e179ea39b","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_0.0.0_1732306653858_0.16447217319078922","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":1732306654022,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732306654022,"dist-tags":{"latest":"1.2.4"}}