{"name":"read-write-mutexify","version":"2.0.0","description":"Like mutexify but with read/write locks","main":"index.js","scripts":{"test":"standard && brittle test.js"},"devDependencies":{"brittle":"^3.3.0","standard":"^17.1.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/read-write-mutexify.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/read-write-mutexify/issues"},"homepage":"https://github.com/mafintosh/read-write-mutexify","gitHead":"8680ca5f7880d73010e34628129209186ff446fe","_id":"read-write-mutexify@2.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-liO4OvGsKqgHDWI1XHeTd2axGlzxPlqene9L51KSNqZm8PNFrMlwkFEafJYHOxdZ2RjsWi0owHhA6lDjmcKVtw==","shasum":"8c6c1993cf7c40f323cc73bb59ae90320bf3ab60","tarball":"http://registry-npm.ywwl.com/read-write-mutexify/download/read-write-mutexify-2.0.0.tgz","fileCount":6,"unpackedSize":6603,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLkBOcvrsIP1pWLpyBwRAumCbLdRoj4Jvu2DgHoAewaAiBrBYfeL3TTLUCKHiEZp4MlvmgGFXxSxNC8PPHcVr/0KQ=="}],"size":2386,"noattachment":false,"key":"/read-write-mutexify/-/read-write-mutexify-2.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-write-mutexify_2.0.0_1685741564052_0.6131300553605348"},"_hasShrinkwrap":false,"readme":"# read-write-mutexify\n\nLike [mutexify](https://github.com/mafintosh/mutexify) but with read/write locks\n\n```\nnpm install read-write-mutexify\n```\n\n## Usage\n\n``` js\nconst RW = require('read-write-mutexify')\n\nconst rw = new RW()\n\n// read locks waits for writer locks to be released\nawait rw.read.lock()\nawait rw.read.lock() // make as many as you want\n\n// unlock with unlock\nrw.read.unlock()\nrw.read.unlock()\n\n// only one writer can have the write lock and it waits\n// for any read lock to be released\n\nawait rw.write.lock()\n\n// unlock with unlock\nrw.write.unlock()\n```\n\n## License\n\nMIT\n","publish_time":1685741564270,"_cnpm_publish_time":1685741564270,"dist-tags":{"latest":"2.1.0"}}