{"name":"log-update-async-hook","version":"2.0.5","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.5","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":"6826e5e0bdd695acfd615898612975ff9971f321","tarball":"http://registry-npm.ywwl.com/log-update-async-hook/download/log-update-async-hook-2.0.5.tgz","fileCount":6,"integrity":"sha512-YqKX8tvQsBHBoJTpMNfs3mf6YfLJrTtpnaOwN0g4dSCEFhSIAC/Bcq0eqEP5OAOBgGvOhhFq4LgxmesyWaGG6g==","signatures":[{"sig":"MEQCIECipeacOhZNAGVSAG+lg9oN9EOLHaXD68NPuR3DsGPZAiAn1dgsKzhH0SkI+hGMoVExGwR3vLNy2BgovSJqpI/z1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFKmDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfCxAAlkdrSL9U+r5tmT+LT6OS7ee9S3vgb1rwdg/63VsReFVo0G1z\r\nZU7EkgUzis+iIpW41eNd+eb0Bs+0ZF+Co/LW5NRINLeob2B6uagBmkXPxI+O\r\nJA1s+dqiZaFOZsavRAmKiAHgYH3r5VnLRKzdQfa3pu+bJr9POGgoj4oL0R9u\r\nrdTCLPiCHAyy8vqwDzhT3bsQkgzXwgBxrmC9wPtACdwPIYL2byMu0no5OHym\r\ns68D3cKjPQMUileCkQf94hXhKBcmokJKvHvoKyXfXZOMUM5W/M+GtHFzAYm7\r\nQG833WN9FgqZbrSzLEXMRV0NqKHf1s+tDTTPUi6Doo4fd/zcUQdw+duAwKmt\r\nIoFrP5/e5YIyK6ykoCGMaHFqTGrkhp5PO5rnz6TEMhSx0E1w8I6XUHzPUatb\r\ndyW1UvqkWv8K2dHEW6srbVCdC0epJfCJidxzWwEybAqTxJxmMv88KeJgmME/\r\noHjuqmhFGat5SUTaNjqvvcj59NSHG3xILTOiLvvaLWuLH6oQzf9OK+bSk+sM\r\nk1ydHItuieQDpoXEPhm2RJKVlgtsdlL5Wz8mX55lCsyWllHk39at6nCyoozh\r\nehMO57S48V3UphZWrzIEuac4cp7y3OvNb7ZI3QVJHFtvh3bf1xVzriPwFi0y\r\ndrV854dZzMU7ujl9kkeEwYxr4D74b+AmwE8=\r\n=82xl\r\n-----END PGP SIGNATURE-----\r\n","size":2975,"noattachment":false,"key":"/log-update-async-hook/-/log-update-async-hook-2.0.5.tgz"},"main":"src/index.js","gitHead":"cf320d1357be9617e2e29380ffe469f35e60c0bb","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.5_1645521283722_0.08957393087390986","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":1645521283812,"_cnpm_publish_time":1645521283812,"dist-tags":{"latest":"2.0.7"}}