{"name":"log-update-async-hook","version":"2.0.6","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.6","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":"33fa4414e73799920edaa64f2f931d2b6f627f68","tarball":"http://registry-npm.ywwl.com/log-update-async-hook/download/log-update-async-hook-2.0.6.tgz","fileCount":6,"integrity":"sha512-UIFPlCpCxrSVL38TXzk34JhhDnvvhsjzuyqooCYy9TtTaVdBLNsuJiTWX9unO/wzBF7RwY1WTCmEmBSI3iPDCA==","signatures":[{"sig":"MEUCIQDMcF3RjAB+wuhi5kQojhglHojHlihg1ao9UnstzbP2qwIgKFifRL7sYhUEKhTY6Zx0dFc58MtQEvxmj8+MkhrhX0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMd7LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4Ew/7B1KA1tFGNpiNbkaBZor9V5T6iAuXYS+oN2Nf2gdgIyGGlSZK\r\ngVdVpTqyO8FBUNS6fTkPIxKx2uhXuFk6jwnBqM/vaSKpz3PBW1d54goq6tTb\r\n/ev15jrBptzgtquJW2eEJbvjax3cD75Vya61ejz7o7BacYeoxZ3cGMO+Iuwj\r\nDx+swprVQ0jkl9bPVxI1+w1B2BAHWAbMry1123w1jwJ9Khf9BYwGACew1LsW\r\nvCRtxq5sBMN9zWmbr6aH2dfm0+hr7fhHAf7PpxGq/TPlj6GX01F8RxoEbMLn\r\n6NRbjZkZrHH00CTPn25LYXgEdodZ0lrOeV77c8vqqCOcoc7DsWvca+vh0f3N\r\nR9IuBuag+gMz92Sy4fNIVNMDzMkwKUVc8k4aCkENfPimF6L5svdu6WHWpHVP\r\nM0ymC8xUaMfTl0GnWRPKjAgaV29+luyq95Pfu4efZm94YLgZwU+t6gorFjcy\r\nf7+ng6QpaKTcKeoUsVuwT5tvfEoWsIOEeugIp5CFVcdceKdnQHsfXs8oaUlQ\r\np4BuYbsxrMlCCydJFcKN3fIevNh8JqLztTeGHpKAbYrPSkI5J54lEmkH10jw\r\nPIPqlhP13jD12rHxd+jo/7I04ebFL7W80CDclUnN07eaxODBOnD73dD+TY58\r\nie7sqysH4PNUghN6GR+ocumYCyS8qms6irQ=\r\n=NImL\r\n-----END PGP SIGNATURE-----\r\n","size":2968,"noattachment":false,"key":"/log-update-async-hook/-/log-update-async-hook-2.0.6.tgz"},"main":"src/index.js","gitHead":"8bc4931ef9c78e7282678721c4c400bfc6747970","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.6_1647435467771_0.8950927983793293","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":1647435467961,"_cnpm_publish_time":1647435467961,"dist-tags":{"latest":"2.0.7"}}