Package Exports
- ready-resource
- ready-resource/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ready-resource) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ready-resource
Modern single resource management
npm install ready-resourceUsage
const ReadyResource = require('ready-resource')
class Thing extends ReadyResource {
constructor () {
super()
}
async _open () {
// open the resource
}
async _close () {
// close the resource
}
}
const r = new Thing()
await r.ready() // calls _open once
await r.ready() // noop
await r.close() // calls _close after _open has finished
await r.close() // noopLicense
MIT