{"name":"observatory","description":"Beautiful UI for showing tasks running on the command line.","version":"1.0.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"},"license":"MIT","main":"lib/observatory","scripts":{"test":"mocha && jshint lib test"},"devDependencies":{"chai":"^3.3.0","faker":"^3.0.1","jshint":"^2.8.0","mocha":"^2.3.3","q":"^1.4.1"},"keywords":["task","watch","status","bower","bower log","logging"],"dependencies":{"ansi-escapes":"^1.1.0","chalk":"^1.1.1","lodash":"^3.10.1"},"gitHead":"6bc860312920a074972a2efc9267618ddae114de","_id":"observatory@1.0.0","_shasum":"2baa606e8299e6866914ec9c8a4db6a41136e59b","_from":".","_npmVersion":"2.13.2","_nodeVersion":"0.11.14","_npmUser":{"name":"dylang","email":"dylang@gmail.com"},"dist":{"shasum":"2baa606e8299e6866914ec9c8a4db6a41136e59b","tarball":"http://registry-npm.ywwl.com/observatory/download/observatory-1.0.0.tgz","integrity":"sha512-kXZ/Jru6ibsZ+Jh3xiW4lT4b5ZceHURPz9EcSHK5a2/zrNfGhY4UVnVyv2xzQnGRlEi6dTFEWs0sGvbZrXgjBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAR/pmvWGFRETYqVANlc7mIRlvBHvniweXVjt8TVCiH3AiEA7WYTe+bE/Owr0CWowcl1WwoUB0QZHE6GFhDV12hAt1Y="}],"size":5744,"noattachment":false,"key":"/observatory/-/observatory-1.0.0.tgz"},"maintainers":[{"name":"dylang","email":"dylang@gmail.com"}],"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":1444913124753,"_cnpm_publish_time":1444913124753,"dist-tags":{"latest":"1.0.0"}}