{"name":"read-write-mutexify","version":"1.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":"9193e580852004ce5433d98fb2d330d799893baf","_id":"read-write-mutexify@1.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-sZHBluMbuJtcxYj1B/sYGr4JCJLYwF2GECeRQb6MwLcjO+BrUG3lzKcwQU5aI0EuDcnVGAuG8uyZBTYbJpct0w==","shasum":"7aca6ce3f860f9136596a359f945bec0945da2a6","tarball":"http://registry-npm.ywwl.com/read-write-mutexify/download/read-write-mutexify-1.0.0.tgz","fileCount":6,"unpackedSize":5745,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3Qp/xOuH0PBQrupWNyCJt+8bwYpEyzD/RuBP98k084wIhAOiztAEad4HOpIvDa02beKdaNqPcsv8Vu6hs8be7rEja"}],"size":2243,"noattachment":false,"key":"/read-write-mutexify/-/read-write-mutexify-1.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_1.0.0_1685708411635_0.8907651284233784"},"_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":1685708411819,"_cnpm_publish_time":1685708411819,"dist-tags":{"latest":"2.1.0"}}