Skip to content

znck/promised

Folders and files

NameName
Last commit message
Last commit date

Latest commit

94624d1 · Jan 15, 2019

History

23 Commits
May 5, 2018
May 5, 2018
Jan 15, 2019
May 5, 2018
Jan 15, 2019
Jan 15, 2019
Jan 15, 2019
May 5, 2018
May 5, 2018
Jan 15, 2019
Jan 15, 2019
Jan 15, 2019
Jan 15, 2019
Jan 15, 2019
Jan 15, 2019

Repository files navigation

@znck/promised Build Status Coverage Status

A utility to make any callback based module/object to return promises.

Installation

npm add @znck/promised # or `pnpm add @znck/promised` or `yarn add @znck/promised`

Usage

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')
  // ...
}