{"name":"composer-runtimes","description":"Write composer task start and end times to a stream.","version":"0.7.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","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"ansi-cyan":"^0.1.1","ansi-gray":"^0.1.1","ansi-green":"^0.1.1","ansi-magenta":"^0.1.1","extend-shallow":"^2.0.1","lazy-cache":"^1.0.2","pretty-time":"^0.2.0","success-symbol":"^0.1.0","time-stamp":"^0.1.3"},"devDependencies":{"capture-stream":"^0.1.2","composer":"^0.8.2","mocha":"*"},"keywords":["composer","runtimes"],"verb":{"plugins":["gulp-format-md"],"related":{"list":["composer","composer-errors"]}},"gitHead":"4b7d2d261517eae0c9c9f346bc6549d0fa4df148","_id":"composer-runtimes@0.7.0","_shasum":"dd681f79c19f0828a91c1fad88d6aad8bab61264","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"dd681f79c19f0828a91c1fad88d6aad8bab61264","tarball":"http://registry-npm.ywwl.com/composer-runtimes/download/composer-runtimes-0.7.0.tgz","integrity":"sha512-hloeMGQtgtOl2jQa1acQQyM4jyMaMh3eEd+uAc1OsPrMe+1yusHn0+gtnfLjNlTj/bYbNB933aYTRxLo6Bnv3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICe5Bn04aMrXr8WX/YEW7e3MxkZHtPqaP0hWxv/LcxRWAiEApGEgMH1fJQBOXZDb5yOTe3FtNGlKiHX320/TcsxfD18="}],"size":3841,"noattachment":false,"key":"/composer-runtimes/-/composer-runtimes-0.7.0.tgz"},"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":1450007485196,"_cnpm_publish_time":1450007485196,"dist-tags":{"latest":"0.7.0"}}