All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.
# run command in the foreground
command
# run commend in the background
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
| // Simple gist to test parallel promise resolution when using async / await | |
| function promiseWait(time) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve(true); | |
| }, time); | |
| }); | |
| } |