Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/znck/promised
A utility to convert callbacks to promises.
https://github.com/znck/promised
callback promise promisified promisify promisifyall
Last synced: about 2 hours ago
JSON representation
A utility to convert callbacks to promises.
- Host: GitHub
- URL: https://github.com/znck/promised
- Owner: znck
- License: mit
- Created: 2018-05-05T09:06:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T22:03:05.000Z (over 4 years ago)
- Last Synced: 2024-08-10T09:13:24.138Z (3 months ago)
- Topics: callback, promise, promisified, promisify, promisifyall
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @znck/promised [![Build Status](https://circleci.com/gh/znck/promised/tree/master.svg?style=shield)](https://circleci.com/gh/znck/promised/) [![Coverage Status](https://coveralls.io/repos/github/znck/promised/badge.svg)](https://coveralls.io/github/znck/promised)
A utility to make any callback based module/object to return promises.
## Installation
``` bash
npm add @znck/promised # or `pnpm add @znck/promised` or `yarn add @znck/promised`
```## Usage
``` js
import promised from '@znck/promised'
import * as fs from 'fs'// ...
if (await promised(fs).exists('example.txt')) {
const contents = await promised(fs).readFile('example.txt')
// ...
}```