Socket
Socket
Sign inDemoInstall

single-line-log

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-line-log - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.npmignore

22

index.js
var MOVE_LEFT = new Buffer('1b5b3130303044', 'hex').toString();
var MOVE_UP = new Buffer('1b5b3141', 'hex').toString();
var CLEAR_LINE = new Buffer('1b5b304b', 'hex').toString();
var stringWidth = require('string-width');

@@ -35,3 +36,7 @@ module.exports = function(stream) {

// How many lines to remove on next clear screen
prevLineCount = nextStr.split('\n').length;
prevLines = nextStr.split('\n');
prevLineCount = prevLines.length;
for (var i=0; i < prevLines.length; i++) {
if (stream.columns < stringWidth(prevLines[i])) prevLineCount += 1;
}
};

@@ -48,16 +53,1 @@

module.exports.stderr = module.exports(process.stderr);
if (require.main !== module) return;
var log = module.exports.stdout;
var i=0;
setInterval(function() {
i++;
var s = 'line 1 - '+Math.random();
if (i < 10) s += ' - '+Math.random();
s += '\nline 2 - '+Math.random();
if (i<20) s += '\nline 3 - '+Math.random()+'\nline 4 - '+Math.random();
log(s);
}, 200);

@@ -17,6 +17,12 @@ {

],
"version": "1.0.1",
"version": "1.1.0",
"repository": "git://github.com/freeall/single-line-log.git",
"license": "MIT",
"author": "Tobias Baunbæk <freeall@gmail.com>"
"author": "Tobias Baunbæk <freeall@gmail.com>",
"dependencies": {
"string-width": "^1.0.1"
},
"scripts": {
"test": "node test.js"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc