{"name":"read-write-mutexify","version":"2.1.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":"b70b0217c362c41a1e86a1fc6f7e7459f17969d1","_id":"read-write-mutexify@2.1.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-fDw/p5/acI1ytVY1UbxEDma/ej1yJH/n9NcjS9YNzcE6sPBPWdlru3ydRa/UBowUg4zqOvNMD5SOGYJrlQ6MzQ==","shasum":"d8915be88863070d44a069163ef69007acd7c622","tarball":"http://registry-npm.ywwl.com/read-write-mutexify/download/read-write-mutexify-2.1.0.tgz","fileCount":6,"unpackedSize":6715,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwlkuMelfrn8drSOxJGATnYwWtAVJLk/iukAVuKaJ6PwIgFvCdEW0m/R0LKBmMXuLEpXMZh2BIZ7+ZRGgqBlsPRWw="}],"size":2397,"noattachment":false,"key":"/read-write-mutexify/-/read-write-mutexify-2.1.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.1.0_1685872629612_0.628150002340802"},"_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":1685872629756,"_cnpm_publish_time":1685872629756,"dist-tags":{"latest":"2.1.0"}}