{"name":"log-update","version":"6.1.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":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"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":"^7.0.0","cli-cursor":"^5.0.0","slice-ansi":"^7.1.0","strip-ansi":"^7.1.0","wrap-ansi":"^9.0.0"},"devDependencies":{"@types/node":"^20.14.12","ava":"^6.1.3","terminal.js":"^1.0.11","tsd":"^0.31.1","wcwidth":"^1.0.1","xo":"^0.59.2"},"xo":{"rules":{"@typescript-eslint/no-unsafe-argument":"off"}},"_id":"log-update@6.1.0","gitHead":"ae78e184f5c5f373bac1b99dc37c5f76abea9060","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/log-update/issues"},"homepage":"https://github.com/sindresorhus/log-update#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==","shasum":"1a04ff38166f94647ae1af562f4bd6a15b1b7cd4","tarball":"http://registry-npm.ywwl.com/log-update/download/log-update-6.1.0.tgz","fileCount":5,"unpackedSize":7576,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKeNyNwE+kEDmGUFY6GBBxG/098FDh6C04DMp0ZtGJkQIhAMSwbXC55YUPMUKg3kvaCNWJfD6EHfmvlvTqI9w70bjZ"}],"size":2939,"noattachment":false,"key":"/log-update/-/log-update-6.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log-update_6.1.0_1722002673415_0.10203210272538898"},"_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":1722002673571,"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_cnpm_publish_time":1722002673571,"dist-tags":{"latest":"8.0.0"}}