mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
428 B
26 lines
428 B
'use strict';
|
|
var restoreCursor = require('restore-cursor');
|
|
var hidden = false;
|
|
|
|
exports.show = function () {
|
|
hidden = false;
|
|
process.stdout.write('\u001b[?25h');
|
|
};
|
|
|
|
exports.hide = function () {
|
|
restoreCursor();
|
|
hidden = true;
|
|
process.stdout.write('\u001b[?25l');
|
|
};
|
|
|
|
exports.toggle = function (force) {
|
|
if (force !== undefined) {
|
|
hidden = force;
|
|
}
|
|
|
|
if (hidden) {
|
|
exports.show();
|
|
} else {
|
|
exports.hide();
|
|
}
|
|
};
|
|
|