{"name":"ready-resource","version":"1.1.1","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"ready-resource@1.1.1","homepage":"https://github.com/mafintosh/ready-resource","bugs":{"url":"https://github.com/mafintosh/ready-resource/issues"},"dist":{"shasum":"bde7318c362d51f29a6db0e63055ba273aa3b40d","tarball":"http://registry-npm.ywwl.com/ready-resource/download/ready-resource-1.1.1.tgz","fileCount":4,"integrity":"sha512-EQbJs+wXphM1opGCpYSp3toAID8okqGDLmhjGLCiptMfMHGcTxdP3lsmSsYwU+lbrUXrbuhhgcDPge656X48VQ==","signatures":[{"sig":"MEQCIGavihjHprlrfcwIV/4OBdP86iKmByo2NEDAyauh5DWDAiA5qkm85yM+DTj4Eb03FLvApVbMK8aPBelNOjPvTsXVAw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3385,"size":1663,"noattachment":false,"key":"/ready-resource/-/ready-resource-1.1.1.tgz"},"main":"index.js","gitHead":"140a89618ff50e8b8b41ebb9c9142880ce955706","imports":{"events":{"bare":"bare-events","default":"events"}},"scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/ready-resource.git","type":"git"},"_npmVersion":"10.7.0","description":"Modern single resource management","directories":{},"_nodeVersion":"20.11.1","dependencies":{"bare-events":"^2.2.0"},"_hasShrinkwrap":false,"devDependencies":{"brittle":"^3.1.0","standard":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ready-resource_1.1.1_1718385804169_0.635292888449535","host":"s3://npm-registry-packages"},"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":1718385804292,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1718385804292,"dist-tags":{"latest":"1.2.0"}}