Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brechtcs/await-callback
https://github.com/brechtcs/await-callback
Last synced: about 11 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/brechtcs/await-callback
- Owner: brechtcs
- License: apache-2.0
- Created: 2020-05-02T13:48:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T21:07:30.000Z (about 4 years ago)
- Last Synced: 2024-10-11T17:29:24.944Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# await-callback
Wrap and await callback code
## Usage
```js
var promise = require('await-callback')
var fs = require('fs')async function main () {
var result = await promise(done => {
fs.writeFile('hello', 'world', 'utf8', err => {
if (err) return done(err)
fs.readFile('hello', 'utf8', done)
})
})console.log(result) // 'world'
}main()
```## License
Apache-2.0