{"name":"log-update-async-hook","version":"2.0.3","keywords":["log","logger","logging","cli","terminal","term","console","shell","update","refresh","overwrite","output","stdout","progress","bar","animation"],"author":{"name":"Andrey Belym","email":"belym.a.2105@gmail.com"},"license":"MIT","_id":"log-update-async-hook@2.0.3","maintainers":[{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"}],"contributors":[{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/AndreyBelym/log-update-async-hook#readme","bugs":{"url":"https://github.com/AndreyBelym/log-update-async-hook/issues"},"dist":{"shasum":"9189bfd48aa47b04acd8d9a2cd009936dd49457f","tarball":"http://registry-npm.ywwl.com/log-update-async-hook/download/log-update-async-hook-2.0.3.tgz","fileCount":6,"integrity":"sha512-7BkVQfineJuibWCT19uR9K3hAAQJm7pYdU+EHf+Am3e6GCdcRA/dnol3cnG052CP/LUzxEloVrnrRdSryAAjYA==","signatures":[{"sig":"MEUCIEjLFqTcFkwfg5uYYTd0D+B0IXc6Md3F95FxuKCi9tz3AiEAkDedNji6c1SVlZA1MEQK7oi/9oLFPQ8wuCVWdzckdew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiC5gfCRA9TVsSAnZWagAAPNQQAJmFc+02CboJd3wU2vYk\n6yxZyftj8rKnwFbdno26U5jWP+sGOs5yg0BxQWyM1uy7Imovgq6PuDmj3051\nYNlwjX0BsY7wxjItiKw5/lu+D4ekKCl5bIc6YhfdP+9FXxmMGBM30d3KZZnK\nGxKeoT3bm0VmWiDVAm2U3ZiPHdkm60pjsyeI5lY58cUQym89u71yDR6IvT0T\nT5pluVRJEZrmAU3LMcz3/7OxICd07iq1dkdMMe0nfTzJzU+nVIO3rQ/lZZCi\nWUzq9XUYU3Y5SiC8Cw+2gUtsarE7TY5BgiEslqHlyNd8+x80yNgb5i5iM8d/\n+j2KNp/HKPJJkEz59f83Mrh0U+fLOlwCuP18OYCn0vZnHdJlNPxaGe/c/fx4\nll4Ww9lGUSQGP/SJ11Ppo5NP8ZTSya9Xjjl3a2P2v/3p0FKKJ1vdCBk2oq96\nU9JQ2eCHfNQlMvJt79RZFL1K2w61DziGgsbXcwniOYBK4NBN+8eQhR95yO1d\nBohoJ7UhvTdVTcWlnmP2dZYXNbzEzWxHR7oVkB2ia9QDXehBybtDCFmu1vE5\nx0wsiegpNzdEDU+1quMFqxe4MdkCsnqvVCi7Xwqpqae0rkLXFiEpFJJOn6MW\nTnonA/t6C+engcPpYAru0JHSRQuBDIUVNaMgiirD2+odl0DTy9npWvCcfrkb\nzMeT\r\n=rsqJ\r\n-----END PGP SIGNATURE-----\r\n","size":2819,"noattachment":false,"key":"/log-update-async-hook/-/log-update-async-hook-2.0.3.tgz"},"main":"src/index.js","gitHead":"3c1824750d3a72d6028659931ddb18517d9de3dc","scripts":{"test":"node test.js"},"_npmUser":{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"},"repository":{"url":"git+https://github.com/AndreyBelym/log-update-async-hook.git","type":"git"},"_npmVersion":"6.14.15","description":"log-update fork that uses async-exit-hook internally","directories":{},"_nodeVersion":"14.17.6","dependencies":{"onetime":"^2.0.1","wrap-ansi":"^2.1.0","ansi-escapes":"^2.0.0","async-exit-hook":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"xo":"*"},"_npmOperationalInternal":{"tmp":"tmp/log-update-async-hook_2.0.3_1644927007505_0.42964725180867","host":"s3://npm-registry-packages"},"readme":"# log-update-async-hook [![Build Status](https://travis-ci.org/AndreyBelym/log-update-async-hook.svg?branch=master)](https://travis-ci.org/AndreyBelym/log-update-async-hook)\n\nThis is a fork of the [log-update](https://github.com/sindresorhus/log-update) by Sindre Sorhus, that uses `async-exit-hook` to restore terminal cursor state when the process terminates.\nUsage of `exit-hook` or `signal-exit` hook in the original `log-update` prevents execution of asynchronous operations on signals (`SIGTERM`, `SIGHUP`, etc.) in the code of the main application.\nSo I've replaced them by `async-exit-hook`, rewritten code to allow execution on Node versions below `4.x` and bundled some dependencies into the package.\n  \n> Log by overwriting the previous output in the terminal.<br>\n> Useful for rendering progress bars, animations, etc.\n\n![](screenshot.gif)\n\n\n## Install\n\n```\n$ npm install --save log-update\n```\n\n\n## Usage\n\n```js\nconst logUpdate = require('log-update');\nconst frames = ['-', '\\\\', '|', '/'];\nlet i = 0;\n\nsetInterval(() => {\n\tconst frame = frames[i = ++i % frames.length];\n\n\tlogUpdate(\n`\n        ♥♥\n   ${frame} unicorns ${frame}\n        ♥♥\n`\n\t);\n}, 80);\n```\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.<br>\nUseful if you want to start a new log session below the current one.\n\n### logUpdate.stderr(text, ...)\n\nLog to stderr.\n\n### logUpdate.stderr.clear()\n### logUpdate.stderr.done()\n\n### logUpdate.create(stream)\n\nGet a `logUpdate` method that logs to the specified stream.\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\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","publish_time":1644927007636,"_cnpm_publish_time":1644927007636,"dist-tags":{"latest":"2.0.7"}}