{"name":"single-line-log","description":"Keep writing to the same line in the terminal. Very useful when you write progress bars, or a status message during longer operations","keywords":["single","line","log","output","overwrite","collapse","stdout","terminal","tty","cli","shell"],"version":"1.0.0","repository":{"type":"git","url":"git://github.com/freeall/single-line-log.git"},"license":"MIT","author":{"name":"Tobias Baunbæk","email":"freeall@gmail.com"},"gitHead":"08dbac00193f25d9fc7c546c65830e38c81f358a","bugs":{"url":"https://github.com/freeall/single-line-log/issues"},"homepage":"https://github.com/freeall/single-line-log#readme","_id":"single-line-log@1.0.0","scripts":{},"_shasum":"0750e264e4205972112a1554e8e75933aeeb175a","_from":".","_npmVersion":"2.8.3","_nodeVersion":"1.8.1","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"0750e264e4205972112a1554e8e75933aeeb175a","tarball":"http://registry-npm.ywwl.com/single-line-log/download/single-line-log-1.0.0.tgz","integrity":"sha512-i1N4pHCY2clVtoojZfWo3C0O20SlJDhgRlf80WojREwjy4Huzils96S7fkHrehd+HPk376fO7IpXP7BHPb1uSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkyaRiEGeCjg6EdgCVi0O6duFjv04xNKQIdCklkiEN+wIhAMTO3btjp6cI1muXZTtzfhnXhL6Lz/QeeEBT+e0d/NM7"}],"size":1411,"noattachment":false,"key":"/single-line-log/-/single-line-log-1.0.0.tgz"},"directories":{},"readme":"# single-line-log\n\nNode.js module that keeps writing to the same line in the console (or a stream). Very useful when you write progress bars, or a status message during longer operations. Supports multilines.\n\n\n## Installation\n\n\tnpm install single-line-log\n\n\n## Usage\n\n``` js\nvar log = require('single-line-log').stdout;\n// or pass any stream:\n// var log = require('single-line-log')(process.stdout);\n\nvar read = 0;\nvar size = fs.statSync('super-large-file').size;\n\nvar rs = fs.createReadStream('super-large-file');\nrs.on('data', function(data) {\n\tread += data.length;\n\tvar percentage = Math.floor(100*read/size);\n\n\t// Keep writing to the same two lines in the console\n\tlog('Writing to super large file\\n[' + percentage + '%]', read, 'bytes read');\n});\n```\n\n## .clear()\n\nClears the log (i.e., writes a newline).\n\n``` js\nvar log = require('single-line-log').stdout;\n\nlog('Line 1');\nlog.clear();\nlog('Line 2');\n```\n\n\n## .stdout\n\nOutputs to `process.stdout`.\n\n\n## .stderr\n\nOutputs to `process.stderr`.\n\n\n## License\n\nMIT","publish_time":1432498820166,"_cnpm_publish_time":1432498820166,"dist-tags":{"latest":"1.1.2"}}