Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getCPUInfo() {
  2.     return new Promise((resolve) => {
  3.         resolve();
  4.     })
  5.     .then(() => {
  6.         console.log("Gathering CPU information...");
  7.         return si.cpu()
  8.         // .then(data => cpuInfo = data) - no need for this, the promise will resolve with "data"
  9.         .catch(err => console.log(err));
  10.     })
  11.     .then(() => {
  12.         console.log("here");
  13.     });
  14. }
  15.  
  16. getCPUInfo().then((cpuInfo) => console.log(cpuInfo));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement