Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

promise method in node js

module.exports.getAllPosts = function()
{
    return new Promise((resolve,reject)=>{

        if(posts == true)
        {
          resolve("success");
        }else{
        reject("Failed");
        }
    });
}
 
PREVIOUS NEXT
Tagged: #promise #method #node #js
ADD COMMENT
Topic
Name
8+3 =