Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[api] Make `ansispan` work in the browser as well

  • Loading branch information...
commit 86d507f1f1c08e01df19efca0509e821cc4b5258 1 parent 4957e7b
@mmalecki authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/ansispan.js
View
6 lib/ansispan.js
@@ -1,4 +1,4 @@
-var ansispan = module.exports = function (str) {
+var ansispan = function (str) {
Object.keys(ansispan.foregroundColors).forEach(function (ansi) {
var span = '<span style="color: ' + ansispan.foregroundColors[ansi] + '">';
@@ -27,3 +27,7 @@ ansispan.foregroundColors = {
'37': 'white'
};
+if (typeof module == "object" && typeof window == "undefined") {
+ module.exports = ansispan;
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.