Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

lestoni/func-to-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

func-to-async

Build Status

NPM

Utility to convert a sync function to async.

Install

  $ npm install func-to-async --save

Usage

  var toAsync = require('func-to-async');

  var asyncFunc = toAsync(syncFunc);

  asyncFunc(function(err) {
    if(err) {
      return console.error(err);
    }
  });

view tests for more examples.

API

func-to-async(fn#Function, [ctx#Object])

fn

Type: Function

The Sync function to convert to async

ctx

Type: Object

optional

context to bind the function to.

License

MIT

About

Utility to create an async function out of a sync one

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published