0.1.10 • Published 6 years ago

process-calls v0.1.10

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Table of Contents

ProcessCalls

Performs synchronization and resolution of callbacks and promises. It works only server-side with NodeJs 5.0.0 or higher.

####Examples of use

####ES6

import fs from 'fs';
import ProcessCalls from 'process-calls';

var myValue = ProcessCalls.receiveProc(fs.readdir,'./');

console.log(myValue);
import ProcessCalls from 'process-calls';

let myPromisse = new Promise(function (resolve, reject) {
    setTimeout(() => {
        try {
            resolve("return string")
        } catch (ex) {
            reject("is bad status");
        }
    }, 5000);
});

var myValue = ProcessCalls.receiveProc(myPromisse);

console.log(myValue);

####ES5

var fs = require('fs');
var ProcessCalls = require('process-calls');

var myValue = ProcessCalls.default.receiveProc(fs.readdir,'./');

console.log(myValue);
var ProcessCalls = require('process-calls');

var myPromisse = new Promise(function (resolve, reject) {
    setTimeout(function () {
        try {
            resolve("return string");
        } catch (ex) {
            reject("is bad status");
        }
    }, 5000);
});

var myValue = ProcessCalls.default.receiveProc(myPromisse);

console.log(myValue);

receiveProc

Function responsible for initiating the process of handling the waiting for the callbacks and promises.

Parameters

  • target object => Function that generates a promise or callback
  • params any (optional, default [])
0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago