Skip to content

Commit

Permalink
Use existing mini-lib for coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 authored and mroderick committed Mar 21, 2018
1 parent 1f33fe5 commit a87ef85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
12 changes: 12 additions & 0 deletions lib/sinon/color.js
Expand Up @@ -17,3 +17,15 @@ exports.red = function (str) {
exports.green = function (str) {
return colorize(str, 32);
};

exports.cyan = function (str) {
return colorize(str, 96);
};

exports.white = function (str) {
return colorize(str, 39);
};

exports.bold = function (str) {
return colorize(str, 1);
};
14 changes: 10 additions & 4 deletions scripts/support-sinon.js
@@ -1,6 +1,12 @@
"use strict";
/* eslint-disable no-console */
console.log(
"\u001b[32mLove sinon? You can now support the project via the open collective:" +
"\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/sinon/donate\u001b[0m\n"
);

var color = require("../lib/sinon/color");

var output =
color.green(
"Love sinon? You can now support the project via the open collective:"
) +
color.white("\n > ") +
color.cyan(color.bold("https://opencollective.com/sinon/donate\n"));
console.log(output);

0 comments on commit a87ef85

Please sign in to comment.