npmtest-auto-install (v0.0.1)

Code coverage report for node-npmtest-auto-install/auto-install/node_modules/cli-cursor/index.js

Statements: 33.33% (5 / 15)      Branches: 0% (0 / 4)      Functions: 0% (0 / 3)      Lines: 33.33% (5 / 15)      Ignored: none     

All files » node-npmtest-auto-install/auto-install/node_modules/cli-cursor/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  1 1   1         1           1                        
'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();
	}
};