mqn-nfpromiser

A short snippet to transform a node-style function into a function returning promises


Keywords
promises, node functions, utils
License
MIT
Install
npm install mqn-nfpromiser@0.0.1

Documentation

mqn-nfpromiser

Build Status

The nfPromiser module has just a single function that takes a node-styled function, executes it and returns a promise.

Installation

    npm install mqn-nfpromiser

Usage

    import nfPromiser from 'mqn-nfpromiser';
    import fs from 'fs';

    nfPromiser(fs.readFile, 'some/path', 'utf8').then((result) => {
        // do something
    }).catch((err) => {
        // handle an error
    });

Tests

    `npm test`

Docs

    `npm docs`

This will build docs at the docs folder.