1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/cli-cursor/index.js

27 lines
428 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
'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();
}
};