3.2.0 • Published 2 years ago
nanoresource-promise v3.2.0
nanoresource-promise
Promises based nanoresource
Install
$ npm install nanoresource-promise
Usage
import { NanoresourcePromise } from 'nanoresource-promise'
;(async () => {
const resource = new NanoresourcePromise({
async open() {
// open the resource
},
async close() {
// close the resource
}
})
await resource.open()
await resource.close()
})()
Event support
import { NanoresourcePromise } from 'nanoresource-promise/emitter' // for emittery support uses 'nanoresource-promise/emittery'
;(async () => {
const resource = new NanoresourcePromise({
async open() {
// open the resource
},
async close() {
// close the resource
}
})
resource.on('open', () => {})
resource.on('opened', () => {})
resource.on('close', () => {})
resource.on('closed', () => {})
await resource.open()
await resource.close()
})()
Issues
:bug: If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
Contributing
:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this guideline.
License
MIT © A GEUT project
3.2.0
2 years ago
3.0.4
2 years ago
3.1.0
2 years ago
3.0.3
2 years ago
3.0.2
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.0
4 years ago
2.0.0-beta.2
4 years ago
2.0.0-beta.1
4 years ago
2.0.0-beta.0
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago