Package Exports
- single-line-log
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (single-line-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
single-line-log
Small Node.js module that keeps writing to the same line in the console. Very useful when you write progress bars, or a status message during longer operations.
Installation
npm install single-line-logUsage
var log = require('single-line-log');
var read = 0;
var size = fs.statSync('super-large-file').size;
var rs = fs.createReadStream('super-large-file');
rs.on('data', function(data) {
read += data.length;
var percentage = Math.floor(100*read/size);
// Keep writing to the same line in the console
log('[' + percentage + '%]', read, 'bytes read');
});License
MIT