console-dope
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -11,3 +11,13 @@ "use strict"; | ||
var dope = module.exports = {}; | ||
exports.log = log; | ||
exports.error = error; | ||
exports.write = write; | ||
exports.hideCursor = hideCursor; | ||
exports.showCursor = showCursor; | ||
exports.column = column; | ||
exports.test = test; | ||
exports.clearToScreenEnd = clearToScreenEnd; | ||
exports.clearToScreenBegin = clearToScreenBegin; | ||
exports.clearScreen = clearScreen; | ||
exports.cursorPosition = cursorPosition; | ||
@@ -122,7 +132,7 @@ /* Control Sequence Initiator */ | ||
function addSgrProperty(flag){ | ||
Object.defineProperty(dope, flag, { | ||
Object.defineProperty(exports, flag, { | ||
enumerable: true, | ||
get: function(){ | ||
sgr.activeFlags.push(flag); | ||
return dope; | ||
return exports; | ||
} | ||
@@ -135,7 +145,7 @@ }); | ||
function addELProperty(flag){ | ||
Object.defineProperty(dope, flag, { | ||
Object.defineProperty(exports, flag, { | ||
enumerable: true, | ||
get: function(){ | ||
EL.activeFlags.push(flag); | ||
return dope; | ||
return exports; | ||
} | ||
@@ -146,3 +156,3 @@ }); | ||
dope.log = function(){ | ||
function log(){ | ||
if (inBrowser){ | ||
@@ -166,5 +176,5 @@ arguments[0] = "%c" + arguments[0]; | ||
return this; | ||
}; | ||
} | ||
dope.error = function(){ | ||
function error(){ | ||
process.stderr.write(sgr.activeSeq()); | ||
@@ -176,5 +186,5 @@ process.stderr.write(EL.activeSeq()); | ||
return this; | ||
}; | ||
} | ||
dope.write = function(txt){ | ||
function write(txt){ | ||
out.write(sgr.activeSeq()); | ||
@@ -186,18 +196,37 @@ out.write(EL.activeSeq()); | ||
return this; | ||
}; | ||
} | ||
dope.hideCursor = function(){ | ||
out.write("\x1b[" + otherCodes.hide); | ||
}; | ||
dope.showCursor = function(){ | ||
out.write("\x1b[" + otherCodes.show); | ||
}; | ||
function hideCursor(){ | ||
out.write(csi + otherCodes.hide); | ||
} | ||
function showCursor(){ | ||
out.write(csi + otherCodes.show); | ||
} | ||
dope.column = function(col){ | ||
out.write(util.format("\x1b[%dG", col)); | ||
function column(col){ | ||
out.write(util.format("%s%dG", csi, col)); | ||
return this; | ||
}; | ||
} | ||
dope.test = function(){ | ||
function test(){ | ||
require("./examples/summary"); | ||
}; | ||
} | ||
function clearToScreenEnd(){ | ||
out.write(util.format("%s0J", csi)); | ||
return exports; | ||
} | ||
function clearToScreenBegin(){ | ||
out.write(util.format("%s1J", csi)); | ||
return exports; | ||
} | ||
function clearScreen(){ | ||
out.write(util.format("%s2J", csi)); | ||
return exports; | ||
} | ||
function cursorPosition(row, column){ | ||
row = row || 1; | ||
column = column || 1; | ||
out.write(util.format("%s%s;%sH", csi, row, column)); | ||
return exports; | ||
} |
{ | ||
"name": "console-dope", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "adds colouring and cursor control features to the console", | ||
@@ -5,0 +5,0 @@ "main": "lib/console-dope.js", |
[](https://www.npmjs.org/package/console-dope) | ||
 | ||
[](https://david-dm.org/75lb/console-dope) | ||
[](https://david-dm.org/75lb/console-dope) | ||
@@ -5,0 +5,0 @@ **work in progress** |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8028
240
0