{"name":"log-update-async-hook","version":"2.0.4","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.4","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":"61693e18ea20de722425135b6fe618c58b214efa","tarball":"http://registry-npm.ywwl.com/log-update-async-hook/download/log-update-async-hook-2.0.4.tgz","fileCount":6,"integrity":"sha512-J3diPMUvvG+kqMfsfb/WFQfRZhiNpK5I8kFFn2Lhdid8gK8G3Xf3vyfMl+6SYdPN1qCO1oFy6ShaDTKpC6NC5A==","signatures":[{"sig":"MEUCIQCR1HZdxG+B3TPKhzJ33PdScGf9nL4ron23CbLcZ1jNPQIgXe/SJKh2F1EPLL0Lx0beiWlDVZfWPZFGdGwTz7UCF0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiD0jhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmou5BAAnOOIUyxXl9KWL2aP51+yg/zhYhiKEqHEi9Ipv1SsdBTqWcyR\r\ns/QKxshMMtYVx+LmXEdRJvUHBabnzfDp2htEkF7BK0NSmJ/hgI/TBZzhuSSu\r\nsdwSf1j0Drxj1CfOOXsvifmHAdCC+jM4FkfqjQ9JwOOVpDHG6csx5ZyNFXQk\r\n/4TWTWjcOkY1nb5PW4D/D5fIiXZzRV5UVrYse18xIfLyi0QTjxj9pWOhc05g\r\nFz3pnrNg7rb0UChvUYYGdRt2bPfwgfwOwHEvlqcGjazhsEaP665JZbkaVyog\r\nUM42u/LAyLZkrARcUjRKD0b7pr4cyIYG+p4x19Aya4EOxbP4qK4Swj5IS4OS\r\nZs6r/MGnNYcXPUskHWBK75MknKZZ0IMWdTqsr1WCluP26kjd2/dyGbu1cFVr\r\nrWMs/MZIafS/fdckXhQZ8rbgz2JoMltwmncwER1OgX+lauvvpaNZtG+Yo075\r\nG+0HAE/nuCXbMQTzQh114GpvtlsDqJzPaYudGeI5nj70gZoy42JbPlmy3p3g\r\nDh05uzpx2esBM63aNAkhcS4OhZ+Ijk+bLqbwPVFYwTYqiipXLDldOnwRyhXA\r\neal36Bep9CyDw8Riqwx0nF+TbsaerlF/MZzu1JjKNI1XThpOFYOVJKLa2WCS\r\nL99g0oox+dQeJqkBMRNGfeOzs2VndnqksP8=\r\n=7rK9\r\n-----END PGP SIGNATURE-----\r\n","size":2988,"noattachment":false,"key":"/log-update-async-hook/-/log-update-async-hook-2.0.4.tgz"},"main":"src/index.js","gitHead":"2953816e1f5d4e7da75d2bab5230d0c1744073bc","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.4_1645168865010_0.4829624884245667","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":1645168865166,"_cnpm_publish_time":1645168865166,"dist-tags":{"latest":"2.0.7"}}