parent
							
								
									31d5741707
								
							
						
					
					
						commit
						3b3d64cf62
					
				@ -0,0 +1,12 @@ | 
				
			|||||||
 | 
					const ora = require('ora'); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = async (text, promise, callback) => { | 
				
			||||||
 | 
					    let spin = ora(text).start(); | 
				
			||||||
 | 
					    await promise | 
				
			||||||
 | 
					        .catch(e => callback(spin, e)) | 
				
			||||||
 | 
					        .then((...args) => { | 
				
			||||||
 | 
					            spin.stop(); | 
				
			||||||
 | 
					            spin.clear(); | 
				
			||||||
 | 
					            callback(spin, args); | 
				
			||||||
 | 
					        }); | 
				
			||||||
 | 
					}; | 
				
			||||||
@ -0,0 +1,7 @@ | 
				
			|||||||
 | 
					module.exports = (time) => { | 
				
			||||||
 | 
					    return new Promise(function (resolve) { | 
				
			||||||
 | 
							setTimeout(function () { | 
				
			||||||
 | 
							  	resolve(null); | 
				
			||||||
 | 
							}, time); | 
				
			||||||
 | 
						}); | 
				
			||||||
 | 
					}; | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue