{"name":"log-update","version":"5.0.0","description":"Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/log-update.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["log","logger","logging","cli","terminal","term","console","shell","update","refresh","overwrite","output","stdout","progress","bar","animation"],"dependencies":{"ansi-escapes":"^5.0.0","cli-cursor":"^4.0.0","slice-ansi":"^5.0.0","wrap-ansi":"^8.0.1"},"devDependencies":{"@types/node":"^16.11.1","ava":"^3.15.0","terminal.js":"^1.0.11","tsd":"^0.18.0","xo":"^0.45.0"},"gitHead":"73424532e029c483b0f5f7155204e33989884ec5","bugs":{"url":"https://github.com/sindresorhus/log-update/issues"},"homepage":"https://github.com/sindresorhus/log-update#readme","_id":"log-update@5.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"integrity":"sha512-HovF3knyZX9sleS0OkSJ6f53JEpbzcbomC6/WJ3iuGK8i6CRb6WZ542gO2F3pdQK8hwlijddDefVFhlMpwkOSQ==","shasum":"e36011f941665b25c2a5585cefdddd399c910c30","tarball":"http://registry-npm.ywwl.com/log-update/download/log-update-5.0.0.tgz","fileCount":5,"unpackedSize":7955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2yO7CRA9TVsSAnZWagAAYdQP/RltAtFQXP5gcvIcBHdZ\nKab+GAIZIdgqiz4ZHYgHzTmJI3pssxSZ/jcoiNlOw/haInIDArIh4wOuugW4\nhezXJwYFeZa995T3Ddybe7S0ztXvij48rNcj0LdI8baosZ7ZFsJBTSgm4vMW\nq1YLlfUDcSq3KUuMIXKCdX/l1s6K/1XI9JvV6FfIXB6O1FHhTNcUfU/6d3+V\nSxXINrsdGn46eZITLELaAOrKGjEvewB1IgYkiC9mFSGcNpiWk0GUYlIJi6K/\noG5hFh4MBHPhWdzKuIGkz62j+TVazvCCLoxRIvSQcBbioGWHuIk53KBd3nlJ\ntnWTgtyONgnAFZONXlK2PoGy1Cn4lQfLQCITvOSptKV2TgTl9Iw/XAFTtmCW\n4KCUT6DsJUqfAKGTA4WIygc0vfVtxP/VwELKD75mubptp3tkQU2tGS/NBVjT\nddRYZBSQyj5quKEzMYy0kXOE3/E1sLN4GfdfpxZML0TAY4UV+FtD+EXeKL+0\n3T/ZwHzY+51EHUHhfWuv1vgFFRPOzTWRATJ2zimtuSGubJ66TwkfQGCbwSke\nfJ/RjBU3kS7JeY7kY4LNbLVZNjRrNBG0wB+lT3xPffFIyBJ8CRFqavEA2rQg\nOhhMPxfr0bFTnmllsrUdz99upsbANqhkcRrm7oBWEoF0A54Xv9JLC9Qw0PRb\nO1Wk\r\n=t138\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHbpu2Tj2fUQtOELhpujrc41Hn0cZo0DVnHnU/GoypcgIhAKbuN7N947RTgHZUdKVOhfpn40+nzJN9DwLepV6SnGdu"}],"size":3113,"noattachment":false,"key":"/log-update/-/log-update-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log-update_5.0.0_1634542277109_0.1403937329310323"},"_hasShrinkwrap":false,"readme":"# log-update\n\n> Log by overwriting the previous output in the terminal.\\\n> Useful for rendering progress bars, animations, etc.\n\n![](screenshot.gif)\n\n## Install\n\n```sh\nnpm install log-update\n```\n\n## Usage\n\n```js\nimport logUpdate from 'log-update';\n\nconst frames = ['-', '\\\\', '|', '/'];\nlet index = 0;\n\nsetInterval(() => {\n\tconst frame = frames[index = ++index % frames.length];\n\n\tlogUpdate(\n`\n        ♥♥\n   ${frame} unicorns ${frame}\n        ♥♥\n`\n\t);\n}, 80);\n```\n\n## API\n\n### logUpdate(text…)\n\nLog to stdout.\n\n### logUpdate.clear()\n\nClear the logged output.\n\n### logUpdate.done()\n\nPersist the logged output.\n\nUseful if you want to start a new log session below the current one.\n\n### logUpdateStderr(text…)\n\nLog to stderr.\n\n### logUpdateStderr.clear()\n### logUpdateStderr.done()\n\n### createLogUpdate(stream, options?)\n\nGet a `logUpdate` method that logs to the specified stream.\n\n#### options\n\nType: `object`\n\n##### showCursor\n\nType: `boolean`\\\nDefault: `false`\n\nShow the cursor. This can be useful when a CLI accepts input from a user.\n\n```js\nimport {createLogUpdate} from 'log-update';\n\n// Write output but don't hide the cursor\nconst log = createLogUpdate(process.stdout, {\n\tshowCursor: true\n});\n```\n\n## Examples\n\n- [listr](https://github.com/SamVerschueren/listr) - Uses this module to render an interactive task list\n- [ora](https://github.com/sindresorhus/ora) - Uses this module to render awesome spinners\n- [speed-test](https://github.com/sindresorhus/speed-test) - Uses this module to render a [spinner](https://github.com/sindresorhus/elegant-spinner)\n","publish_time":1634542277251,"_cnpm_publish_time":1634542277251,"dist-tags":{"latest":"8.0.0"}}