{"name":"scope-lock","version":"1.1.0","author":{"name":"Holepunch Inc."},"license":"Apache-2.0","_id":"scope-lock@1.1.0","homepage":"https://github.com/holepunchto/scope-lock","bugs":{"url":"https://github.com/holepunchto/scope-lock/issues"},"dist":{"shasum":"09d449f1ef88d689bb64310a791ed04f21343d57","tarball":"http://registry-npm.ywwl.com/scope-lock/download/scope-lock-1.1.0.tgz","fileCount":4,"integrity":"sha512-oKCWVrXuppkk412W8B4qTmLfYfUu5yG8dUH7z87cVrOS+IkJQb8jcfkToeeSZIVRwkuS8mGeF6gZuf1MEOAu8g==","signatures":[{"sig":"MEQCIGCAsigaCpgysRdMg+cYYKoLxc1hrXIsGEGWWMiviIVVAiBLmsswYFgGVk32ji5oIGaZnadv4aXmIEHyzgRb51B4CQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13889,"size":5026,"noattachment":false,"key":"/scope-lock/-/scope-lock-1.1.0.tgz"},"main":"index.js","gitHead":"9a186df1f344ab6dd96578ee921e8d26e72ce1a3","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.1.0_1732307712903_0.4732646836609864","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":1732307713065,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1732307713065,"dist-tags":{"latest":"1.2.4"}}