{"name":"observatory","description":"Beautiful UI for showing tasks running on the command line.","version":"0.1.0","homepage":"https://github.com/dylang/observatory","author":{"name":"Dylan Greene","email":"dylang@gmail.com"},"repository":{"type":"git","url":"git://github.com/dylang/observatory.git"},"bugs":{"url":"https://github.com/dylang/observatory/issues"},"licenses":[{"type":"MIT","url":"https://github.com/dylang/observatory/blob/master/LICENSE-MIT"}],"main":"lib/observatory","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-watch":"~0.5.1","grunt":"~0.4.1","chai":"~1.8.1","grunt-notify":"~0.2.7","Faker":"~0.5.11","grunt-cafe-mocha":"~0.1.8","q":"~0.9.7"},"keywords":["task","watch","status","bower","bower log","logging"],"dependencies":{"cli-color":"~0.2.2","lodash":"~2.2.1"},"_id":"observatory@0.1.0","dist":{"shasum":"e6348d8242451f6c46c9bf8cf5c60849364cf33f","tarball":"http://registry-npm.ywwl.com/observatory/download/observatory-0.1.0.tgz","integrity":"sha512-Utm9f7xsSGV7Gc98bqdIM4hsUefKiWqYzAtUeHfjZcEQQ9IS2GaMcNx9edz3tTk4BNoSnItk0BKDffvVZXzDxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl+WZ62RoPcgr+Z42cWDNUfVoN+rxG19LimRpKKMbmIgIgQRjo5g6lTLONtkqehg9zxa9pIED3WqWXlOjqvdEx+l8="}],"size":6438,"noattachment":false,"key":"/observatory/-/observatory-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"dylang","email":"dylang@gmail.com"},"maintainers":[{"name":"dylang","email":"dylang@gmail.com"}],"directories":{},"readme":"# Observatory [![Build Status](https://secure.travis-ci.org/dylang/observatory.svg?branch=master)](http://travis-ci.org/dylang/observatory)\n\n> Beautiful UI for showing tasks running on the command line.\n\n## Purpose\n\nInstead of just logging long running tasks to the console, give your users a simple status dashboard.\n\n![observatory](https://f.cloud.github.com/assets/51505/1339977/2cccefbe-361a-11e3-9cca-3bcf74f7e59b.gif)\n\n## Installation\n\n```bash\n$ npm -g install observatory\n```\n\n## Examples\n\n### `node ./examples/buzzwords.js`\n\nAn example using fake data that tries to look like a real-world usage.\n\n### `node ./examples/long-line.js`\n\nAn example of what happens when text is so long it needs to wrap to another line.\n\n## Usage Example\n\n```js\nvar observatory = require('observatory');\n\n//add a task to display\nvar task = observatory.add('Install packages...');\n\n//while working on the task, update the status\ntask.running('Copying Files');\n\n//optionally give details\ntask.details(percent + '% ' + filename);\n\n//chain commands\ntask.status('Compressing Images')\n    .details(directoryName);\n\n//when complete\ntask.done('Finished!');\n\n//or if it failed\ntask.fail('Ooops');\n```\n\n## Terminology\n\n```text\n[Test Runner] Running tests on Safari  Running Now  50%  CSS3 Tests\n⇧ prefix      ⇧ description            ⇧ status     ⇧ details\n```\n\n## API\n\n### `observatory.add(description)`\n\n`description` _string_ Required description.  \n**returns** a new `task`\n\nAdds a task to the console. This method returns a `task` object, you should store it in a variable so you can use it for the methods bellow.\n\n```\nvar copyFilesTask = observatory.add('Copy files');\n```\n\n## Task Methods\n\nAll task methods return the `task` object so that you can chain functions, such as `task.done().status('Installed!');`.\n\n### `task.status(statusLabel)`\n\n`statusLabel` _string_ Set the status value.\n\nDisplays a short message to the right of the description. Use it to show users in a word or two that suggests what is happening.\n\nExamples:\n\n* `task.status('Downloading');`\n* `task.status('Running');`\n* `task.status('Complete');`\n\n### `task.details(detailsLabel)`\n\n`detailsLabel` _string_ Set the details value.\n\nOptional provide details about what's happening, such as file names, urls, tests names.\n\nExamples:\n\n* `task.details('Copying var/tmp/whatever to var/whater/tmp');`\n* `task.details('Compressing bigimage.png');`\n* `task.details('Testing services');`\n\n### `task.done(statusLabel)`\n\n`statusLabel` _string_ Set the status value. Default: `✓ Done`.\n\n* `task.done();`\n* `task.done('Compressed!')`\n\n### `task.fail(statusLabel)`\n\n`statusLabel` _string_ Set the status value. Default: `✗ Failed`.\n\n* `task.fail();`\n* `task.fail('Disconnected');\n\n\n## Override Settings\n\n### `observatory.settings(settingsObject)`\n\nTweak how tasks are rendered. \n\n`settingsObject`\n\n* `width` Integer, width in _characters_ of the `description` and `status` area. This is used to right justify the `status`. Default is `55`.\n* `prefix` Sting, Text to prepend each line. Default is `' ⫸  '`.\n* `write` Function(content). Writes the content to the output. Defaults to `process.stdout.write`.\n* `formatStatus` Function(statusLabel, STATE)\n\n> **returns** `observatory` so you can use it on the `require` statement.\n\n```\nvar observatory = require('observatory').settings({\n  prefix: '[bower] '.white\n});\n```\n\n### observatory.STATE\n\nA constant for the different states. Only useful if you need to change `formatStatus` above.\n\nThe values:\n\n* `observatory.STATE.active` Defaults to using default console color.\n* `observatory.STATE.done` Defaults to using green.\n* `observatory.STATE.fail` Defaults to using red.\n\n## Acknowledgements\n\n### Inspiration\n\n* My coworker Nick at Opower for inspiring the need for this library.\n* Bower, inspiring the clean layout.\n* Inqurire.js, for showing console apps can have a nice UI.\n\n\n## Release History\n* 15 October 2015 - 1.0.0 - Update dependencies, fix tests and bugs thanks to @rstacruz.\n* 20 October 2013 - 0.1.0 - Some cleanup thanks to @nickheiner, new write method.\n* 15 October 2013 - 0.0.1 - First version\n\n## License\nCopyright (c) 2015 Dylan Greene  \nLicensed under the MIT license.\n","publish_time":1382304251301,"_cnpm_publish_time":1382304251301,"dist-tags":{"latest":"1.0.0"}}