{"name":"log-update-async-hook","version":"2.0.1","keywords":["log","logger","logging","cli","terminal","term","console","shell","update","refresh","overwrite","output","stdout","progress","bar","animation"],"author":{"url":"sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"log-update-async-hook@2.0.1","maintainers":[{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"}],"homepage":"https://github.com/sindresorhus/log-update#readme","bugs":{"url":"https://github.com/sindresorhus/log-update/issues"},"dist":{"shasum":"da49a6bd31e7c18d086784e48022f3e6f071dd00","tarball":"http://registry-npm.ywwl.com/log-update-async-hook/download/log-update-async-hook-2.0.1.tgz","integrity":"sha512-bikpieC7ErwU+jPxj4MQFYvwAvLe2VIbVBgZY4bqaMchHxebzwE/Kp8qH/6KbZV1nzfvXU0f95feboSlYd3u/w==","signatures":[{"sig":"MEYCIQCSmUFDq6dk7/hZKbN3enIt6iagFug1Qv9L9m3v6giO+AIhAOWZ5T+8w/6SRNJjSK+ag6o+VqRXsnEu3EmRibzCeFN6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":2476,"noattachment":false,"key":"/log-update-async-hook/-/log-update-async-hook-2.0.1.tgz"},"main":"src/index.js","files":["src"],"gitHead":"f1270bfd29eadab7d9cf94e04d782f666b01c0be","scripts":{"test":"xo && node test.js"},"_npmUser":{"name":"belym.a.2105","email":"belym.a.2105@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/log-update.git","type":"git"},"_npmVersion":"5.0.0","description":"Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc.","directories":{},"_nodeVersion":"8.0.0","dependencies":{"onetime":"^2.0.1","wrap-ansi":"^2.1.0","ansi-escapes":"^2.0.0","async-exit-hook":"^1.1.2"},"devDependencies":{"xo":"*"},"_npmOperationalInternal":{"tmp":"tmp/log-update-async-hook-2.0.1.tgz_1498635508089_0.2664961607661098","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":1498635509135,"_cnpm_publish_time":1498635509135,"dist-tags":{"latest":"2.0.7"}}