4.2.1 • Published 1 month ago

ezito-async v4.2.1

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

Installation

npm install ezito-async
const ea = require('ezito-async');

new Promise(res => { 
    setTimeout(() => {
        console.log("Promise end")
        res(1);
    }, 1000);
});
console.log("---end---");


// output frist ---end---
// and output -> Promise end
const ea = require('ezito-async');
new Promise(res => { 
    setTimeout(() => {
        console.log("Promise end") // output second
        res(1);
    }, 1000);
});
console.log("---end--"); // output frist
var res = ea.sync(async result => {
    await new Promise(res => {
        result(1);
        setTimeout(() => {
            res(1);
        }, 2000);
    })
});
console.log(res) // output 1 called result in sync
console.log("---end--") // output the end
const ea = require('ezito-async');
const axios = require("axios");

var result = ea.loop(function(set_result){
    axios.get("https://example.com").then(({ data }) => {
        set_result(data)
    });
});

console.log(result)
4.1.0

1 month ago

4.0.0

1 month ago

4.2.1

1 month ago

3.3.1

2 months ago

3.3.0

2 months ago

3.2.1

2 months ago

3.1.1

2 months ago

3.0.1

2 months ago

3.0.0

2 months ago

2.0.0

2 months ago

1.1.0

2 months ago

1.0.0

2 months ago