{"name":"ready-resource","version":"1.2.0","description":"Modern single resource management","main":"index.js","imports":{"events":{"bare":"bare-events","default":"events"}},"types":"index.d.ts","scripts":{"test":"standard && brittle test.js"},"devDependencies":{"brittle":"^3.1.0","standard":"^17.0.0"},"repository":{"type":"git","url":"git+https://github.com/holepunchto/ready-resource.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/holepunchto/ready-resource/issues"},"homepage":"https://github.com/holepunchto/ready-resource","dependencies":{"bare-events":"^2.2.0"},"_id":"ready-resource@1.2.0","gitHead":"4136c76bfcac1b1cadcbfa47b22be08a200c20fd","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-nfcco/8iAFV0M+2PYnmIc+/xY0iRb35d42HFHQ7AfjulbGEAFa+XWpByfwSyeVeiBoMLLFVMv1HixxNCqzSQ1g==","shasum":"4d5b78f96b707bcba3fce972ec89bdf7c1e3993c","tarball":"http://registry-npm.ywwl.com/ready-resource/download/ready-resource-1.2.0.tgz","fileCount":5,"unpackedSize":5354,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFDx23QGOYRXNFwCYPZ5iZ+mxcZImfBcrYosZvFiL0iPAiEAlR5GQEYFIwGR5hV+CFaTxqkxwyWWmzbY44QDLuweOps="}],"size":2225,"noattachment":false,"key":"/ready-resource/-/ready-resource-1.2.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ready-resource_1.2.0_1755700058090_0.027127692252524538"},"_hasShrinkwrap":false,"readme":"# ready-resource\n\nModern single resource management\n\n```\nnpm install ready-resource\n```\n\n## Usage\n\n``` js\nconst ReadyResource = require('ready-resource')\n\nclass Thing extends ReadyResource {\n  constructor () {\n    super()\n  }\n\n  async _open () {\n    // open the resource\n  }\n\n  async _close () {\n    // close the resource\n  }\n}\n\nconst r = new Thing()\n\nawait r.ready() // calls _open once\nawait r.ready() // noop\n\nawait r.close() // calls _close after _open has finished\nawait r.close() // noop\n```\n\n## License\n\nMIT\n","publish_time":1755700058356,"_cnpm_publish_time":1755700058356,"dist-tags":{"latest":"1.2.0"}}