{"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":"0.1.2","repository":{"type":"git","url":"git://github.com/freeall/single-line-log.git"},"author":{"name":"Tobias Baunbæk","email":"freeall@gmail.com"},"bugs":{"url":"https://github.com/freeall/single-line-log/issues"},"homepage":"https://github.com/freeall/single-line-log","_id":"single-line-log@0.1.2","dist":{"shasum":"306c4782b733461655ea3622655bab7ee401b97f","tarball":"http://registry-npm.ywwl.com/single-line-log/download/single-line-log-0.1.2.tgz","integrity":"sha512-ZNXg8XrmOX2EyOmXSqKgK8TGCYfYZ3T9EctRdPeq32wjwZrWZxkx+ulx14127VO2FwFAmyRtfwWE9J3BWJGelg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDF7mTnein9rtf09SdbI36VYkPAchnj53DWIM6KyWE81AiEA+8eg4LzRp+4u4gj24KlO6BcBVsrZS+Ba+Wc6CWXNcnU="}],"size":1055,"noattachment":false,"key":"/single-line-log/-/single-line-log-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"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":1384358783921,"_cnpm_publish_time":1384358783921,"dist-tags":{"latest":"1.1.2"}}