0.1.10 • Published 7 years ago
process-calls v0.1.10
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
- targetobject => Function that generates a promise or callback
- paramsany (optional, default- [])