Skip to content

Instantly share code, notes, and snippets.

@zmnv
Created April 15, 2018 04:17
Show Gist options
  • Save zmnv/0e178cb2f11b7396a996a784ce730576 to your computer and use it in GitHub Desktop.
Save zmnv/0e178cb2f11b7396a996a784ce730576 to your computer and use it in GitHub Desktop.
Разукрашивает текст
'use strict';
const cs = (text, colorForeground, colorBackground) =>
colorBackground ?
`\x1b[${colorForeground}m\x1b[${colorBackground}m${text}\x1b[0m` :
`\x1b[${colorForeground}m${text}\x1b[0m`;
module.exports = cs;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment