Comparing version 0.1.2 to 0.2.0
37
index.js
@@ -218,2 +218,39 @@ var tty = require('tty'); | ||
Charm.prototype.delete = function (s, n) { | ||
n = n || 1 | ||
if (s === 'line') { | ||
this.write(encode('[' + n + 'M')); | ||
} | ||
else if (s === 'char') { | ||
this.write(encode('[' + n + 'M')); | ||
} | ||
else { | ||
this.emit('error', new Error('Unknown delete type: ' + s)); | ||
} | ||
return this; | ||
}; | ||
Charm.prototype.insert = function (mode, n) { | ||
n = n || 1 | ||
if(mode === true) { | ||
this.write(encode('[4h')); | ||
} | ||
else if (mode === false) { | ||
this.write(encode('[l')); | ||
} | ||
else if (mode === 'line') { | ||
this.write(encode('[' + n + 'L')); | ||
} | ||
else if (mode === 'char') { | ||
this.write(encode('[' + n + '@')); | ||
} | ||
else { | ||
this.emit('error', new Error('Unknown delete type: ' + s)); | ||
} | ||
return this; | ||
}; | ||
Charm.prototype.display = function (attr) { | ||
@@ -220,0 +257,0 @@ var c = { |
{ | ||
"name" : "charm", | ||
"version" : "0.1.2", | ||
"version" : "0.2.0", | ||
"description" : "ansi control sequences for terminal cursor hopping and colors", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19169
491
234