check for process.stdout.clearLine api before using it