{"name":"composer-runtimes","description":"Write composer task start and end times to a stream.","version":"0.1.0","homepage":"https://github.com/doowb/composer-runtimes","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/composer-runtimes.git"},"bugs":{"url":"https://github.com/doowb/composer-runtimes/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"composer":"^0.2.0","mocha":"*"},"dependencies":{"ansi-cyan":"^0.1.1","ansi-green":"^0.1.1","ansi-red":"^0.1.1","ansi-yellow":"^0.1.1","lazy-cache":"^0.2.0"},"verb":{"related":{"list":["composer"]}},"gitHead":"ea7b484fa832b9db4347e2530acef7572abc6507","_id":"composer-runtimes@0.1.0","_shasum":"2d1daa3601a71ff46c9baf3732a65c630cf222ec","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"2d1daa3601a71ff46c9baf3732a65c630cf222ec","tarball":"http://registry-npm.ywwl.com/composer-runtimes/download/composer-runtimes-0.1.0.tgz","integrity":"sha512-ohdeMQ8TMFwVI/DOXFDqzhGrqk13ZdoJTF+LiBZ/qFEg5tbaNrnGvS/6BqCUkSDZ/CSXPWVZaUMcREzn6jY+aA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzT1wZ11fU3Q9OurKPZfVbXRcbY7BQouPx9b6x28WUsAiAxJIgtxNzF0m8gO3Sk2C06vVUnVF26NuOW+0zi6JNmVg=="}],"size":2430,"noattachment":false,"key":"/composer-runtimes/-/composer-runtimes-0.1.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"directories":{},"readme":"# composer-runtimes [![NPM version](https://img.shields.io/npm/v/composer-runtimes.svg)](https://www.npmjs.com/package/composer-runtimes) [![Build Status](https://img.shields.io/travis/doowb/composer-runtimes.svg)](https://travis-ci.org/doowb/composer-runtimes)\n\n> Write composer task start and end times to a stream.\n\n_HEADS UP_ Api changes in `0.5.0`\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i composer-runtimes --save\n```\n\n## Usage\n\n```js\nvar composer = require('composer');\nvar runtimes = require('composer-runtimes');\n```\n\n## API\n\n### [runtimes](index.js#L27)\n\nListen to composer events and output runtime information.\n\n**Params**\n\n* `options` **{Object}**: Options to specify color output and stream to write to.\n* `options.colors` **{Boolean}**: Show ansi colors or not. `true` by default\n* `options.stream` **{Stream}**: Output stream to write to. `process.stderr` by default.\n* `options.displayName` **{Function}**: Override how the task name is displayed. [See below][displayName]\n* `options.displayTime` **{Function}**: Override how the starting and finished times are displayed. [See below][displayTime]\n* `options.displayDuration` **{Function}**: Override how the run duration is displayed. [See below][displayDuration]\n\n**Example**\n\n```js\nruntimes({colors: false})(composer);\n```\n\n### [displayName](index.js#L91)\n\nOverride how the task name is displayed.\n\n**Params**\n\n* `name` **{String}**: Task name\n* `options` **{Object}**: Options passed to `runtimes` and extend with application specific options.\n* `returns` **{String}**: display name\n\n**Example**\n\n```js\nvar options = {\n  displayName: function(name, opts) {\n    // `this` is the entire `task` object\n    return 'Task: ' + name;\n  }\n};\n\ncomposer.use(runtimes(options));\n```\n\n### [displayTime](index.js#L123)\n\nOverride how run times are displayed.\n\n**Params**\n\n* `time` **{Date}**: Javascript `Date` object.\n* `options` **{Object}**: Options passed to `runtimes` and extend with application specific options.\n* `returns` **{String}**: display time\n\n**Example**\n\n```js\nvar formatTime = require('time-stamp')\nvar options = {\n  displayTime: function(time, opts) {\n    // `this` is the entire `run` object\n    var formatted = formatTime('HH:mm:ss.ms', time);\n    return 'Time: ' + formatted;\n  }\n};\ncomposer.use(runtimes(options));\n```\n\n### [displayDuration](index.js#L162)\n\nOverride how duration times are displayed.\n\n**Params**\n\n* `duration` **{Array}**: Array from `process.hrtime()`\n* `options` **{Object}**: Options passed to `runtimes` and extend with application specific options.\n* `returns` **{String}**: display duration\n\n**Example**\n\n```js\nvar pretty = require('pretty-time');\nvar options = {\n  displayDuration: function(duration, opts) {\n    // `this` is the entire `run` object\n    var formatted = pretty(duration, 'μs', 2);\n    return 'Duration: ' + formatted;\n  }\n};\n\ncomposer.use(runtimes(options));\n```\n\n## Related projects\n\n* [composer](https://www.npmjs.com/package/composer): API-first task runner with three methods: task, run and watch. | [homepage](https://github.com/jonschlinkert/composer)\n* [composer-errors](https://www.npmjs.com/package/composer-errors): Listen for and output Composer errors. | [homepage](https://github.com/doowb/composer-errors)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/composer-runtimes/issues/new).\n\n## Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](http://twitter.com/doowb)\n\n## License\n\nCopyright © 2015 [Brian Woodward](https://github.com/doowb)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 13, 2015._","publish_time":1439946182500,"_cnpm_publish_time":1439946182500,"dist-tags":{"latest":"0.7.0"}}