{"_id":"pretty-time","_rev":"107166","name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:39:04.000Z","created":"2015-10-12T09:33:44.566Z","1.1.0":"2018-07-12T17:20:27.690Z","1.0.0":"2018-03-19T19:33:37.408Z","0.2.0":"2015-10-21T00:38:42.310Z","0.1.2":"2015-10-18T09:16:48.236Z","0.1.1":"2015-10-18T09:14:48.894Z","0.1.0":"2015-10-12T09:33:44.566Z"},"users":{"joaquin.briceno":true,"arttse":true,"pedromsilva":true,"rocket0191":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"versions":{"1.1.0":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"1.1.0","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["o-clock","seconds","time-stamp","timescale","week","weekday","year"]},"lint":{"reflinks":true}},"gitHead":"c4b3f79c08adb9a16f6a93152920dd1a63c18f96","_id":"pretty-time@1.1.0","_npmVersion":"6.1.0","_nodeVersion":"10.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"ffb7429afabb8535c346a34e41873adf3d74dd0e","size":3909,"noattachment":false,"key":"/pretty-time/-/pretty-time-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-1.1.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pretty-time_1.1.0_1531416027618_0.879139442124429"},"_hasShrinkwrap":false,"publish_time":1531416027690,"_cnpm_publish_time":1531416027690},"1.0.0":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^5.0.0","nanoseconds":"^1.0.0"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["o-clock","seconds","time-stamp","timescale","week","weekday","year"]},"lint":{"reflinks":true}},"gitHead":"ea522608e06b3aaf2d68e2485f62eab072a59e17","_id":"pretty-time@1.0.0","_npmVersion":"5.7.1","_nodeVersion":"9.7.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"544784adecaa2cd7d045ff8a8f1d4791c8e06e23","size":3890,"noattachment":false,"key":"/pretty-time/-/pretty-time-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-1.0.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pretty-time_1.0.0_1521488017345_0.17808717510681848"},"_hasShrinkwrap":false,"publish_time":1521488017408,"_cnpm_publish_time":1521488017408},"0.2.0":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^2.0.2","nanoseconds":"^0.1.0"},"devDependencies":{"gulp":"^3.9.0","gulp-istanbul":"^0.10.1","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.0.1","mocha":"*"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"related":{"list":["time-stamp","timescale","o-clock","seconds","week","weekday","year"]}},"gitHead":"3f3081fcc3ba90dc5affbbf72a9a6b9912699524","_id":"pretty-time@0.2.0","_shasum":"7a3bdec4049c620cd7c42b7f342b74d56e73d74e","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"7a3bdec4049c620cd7c42b7f342b74d56e73d74e","size":3348,"noattachment":false,"key":"/pretty-time/-/pretty-time-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-0.2.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1445387922310,"_cnpm_publish_time":1445387922310,"_hasShrinkwrap":false},"0.1.2":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^2.0.2"},"devDependencies":{"gulp":"^3.9.0","gulp-istanbul":"^0.10.1","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.0.1","mocha":"*"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"related":{"list":["time-stamp","timescale","o-clock","seconds","week","weekday","year"]}},"gitHead":"ac3f8d2ce2a60174330f79cceced014d9478d579","_id":"pretty-time@0.1.2","_shasum":"c1b92b1bc5d2c04ee54be3c91342490ab8baf38e","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c1b92b1bc5d2c04ee54be3c91342490ab8baf38e","size":3334,"noattachment":false,"key":"/pretty-time/-/pretty-time-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-0.1.2.tgz"},"directories":{},"publish_time":1445159808236,"_cnpm_publish_time":1445159808236,"_hasShrinkwrap":false},"0.1.1":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^2.0.2"},"devDependencies":{"gulp":"^3.9.0","gulp-istanbul":"^0.10.1","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.0.1","mocha":"*"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"related":{"list":["time-stamp","timescale","o-clock","seconds","week","weekday","year"]}},"gitHead":"5b422cd12dc92eaeb7d54ddb702348445c6880c1","_id":"pretty-time@0.1.1","_shasum":"dcac121c2adce2512e159626892f0d7d99c761db","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"dcac121c2adce2512e159626892f0d7d99c761db","size":3340,"noattachment":false,"key":"/pretty-time/-/pretty-time-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-0.1.1.tgz"},"directories":{},"publish_time":1445159688894,"_cnpm_publish_time":1445159688894,"_hasShrinkwrap":false},"0.1.0":{"name":"pretty-time","description":"Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/pretty-time","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-number":"^2.0.2"},"devDependencies":{"gulp":"^3.9.0","gulp-istanbul":"^0.10.1","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.0.1","mocha":"*"},"keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"verb":{"related":{"list":["time-stamp","timescale","o-clock","seconds","week","weekday","year"]}},"gitHead":"5b422cd12dc92eaeb7d54ddb702348445c6880c1","_id":"pretty-time@0.1.0","_shasum":"6e0a7f78dffd12bd6ece915d03c00ab23d447180","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"6e0a7f78dffd12bd6ece915d03c00ab23d447180","size":3083,"noattachment":false,"key":"/pretty-time/-/pretty-time-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pretty-time/download/pretty-time-0.1.0.tgz"},"directories":{},"publish_time":1444642424566,"_cnpm_publish_time":1444642424566,"_hasShrinkwrap":false}},"readme":"# pretty-time [![NPM version](https://img.shields.io/npm/v/pretty-time.svg?style=flat)](https://www.npmjs.com/package/pretty-time) [![NPM monthly downloads](https://img.shields.io/npm/dm/pretty-time.svg?style=flat)](https://npmjs.org/package/pretty-time) [![NPM total downloads](https://img.shields.io/npm/dt/pretty-time.svg?style=flat)](https://npmjs.org/package/pretty-time) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/pretty-time.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/pretty-time)\n\n> Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save pretty-time\n```\n\n## Usage\n\n```js\nvar pretty = require('pretty-time');\n\nvar start = process.hrtime();\nvar time = process.hrtime(start);\nconsole.log(pretty(time));\n//=> 3μs\n```\n\n## API\n\nBy default, when no time increment is given as the second argument, the closest timescale is used (e.g. _most granular without being less than zero_).\n\n**Examples:**\n\n```js\npretty([1200708, 795428088]);\n//=> '2w'\n\npretty([800708, 795428088]);\n//=> '1w'\n\npretty([400708, 795428088]);\n//=> '5d'\n\npretty([70708, 795428088]);\n//=> '20h'\n\npretty([12708, 795428088]);\n//=> '4h'\n\npretty([3708, 795428088]);\n//=> '1h'\n\npretty([208, 795428088]);\n//=> '3m'\n\npretty([20, 795428088]);\n//=> '21s'\n\npretty([0, 795428088]);\n//=> '795ms'\n\npretty([0, 000428088]);\n//=> '428μs'\n\npretty([0, 000000088]);\n//=> '88ns'\n\npretty([0, 000000018]);\n//=> '18ns'\n```\n\n### Minimum time increment\n\n_(All of the following examples use `[6740, 795428088]` as the hrtime array.)_\n\nThis value is passed as the second argument and determines how granular to make the time.\n\n**Examples**\n\n```js\npretty(time, 'h');\n//=> '2h'\n\npretty(time, 'm');\n//=> '1h 52m'\n\npretty(time, 's');\n//=> '1h 52m 21s'\n```\n\n**Valid time increments**\n\nAny of the following may be used:\n\n* `ns` | `nano` | `nanosecond` | `nanoseconds`\n* `μs` | `micro` | `microsecond` | `microseconds`\n* `ms` | `milli` | `millisecond` | `milliseconds`\n* `s` | `sec` | `second` | `seconds`\n* `m` | `min` | `minute` | `minutes`\n* `h` | `hr` | `hour` | `hours`\n* `d` | `day` | `days`\n* `w` | `wk` | `week` | `weeks`\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [o-clock](https://www.npmjs.com/package/o-clock): Simple javascript utility for displaying the time in 12-hour clock format. | [homepage](https://github.com/jonschlinkert/o-clock \"Simple javascript utility for displaying the time in 12-hour clock format.\")\n* [seconds](https://www.npmjs.com/package/seconds): Get the number of seconds for a minute, hour, day and week. | [homepage](https://github.com/jonschlinkert/seconds \"Get the number of seconds for a minute, hour, day and week.\")\n* [time-stamp](https://www.npmjs.com/package/time-stamp): Get a formatted timestamp. | [homepage](https://github.com/jonschlinkert/time-stamp \"Get a formatted timestamp.\")\n* [timescale](https://www.npmjs.com/package/timescale): Convert from one time scale to another. Nanosecond is the most atomic unit, week is… [more](https://github.com/jonschlinkert/timescale) | [homepage](https://github.com/jonschlinkert/timescale \"Convert from one time scale to another. Nanosecond is the most atomic unit, week is the largest unit.\")\n* [week](https://www.npmjs.com/package/week): Get the current week number. | [homepage](https://github.com/datetime/week \"Get the current week number.\")\n* [weekday](https://www.npmjs.com/package/weekday): Get the name and number of the current weekday. Or get the name of the… [more](https://github.com/datetime/weekday) | [homepage](https://github.com/datetime/weekday \"Get the name and number of the current weekday. Or get the name of the weekday for a given number.\")\n* [year](https://www.npmjs.com/package/year): Simple utility to get the current year with 2 or 4 digits. | [homepage](https://github.com/jonschlinkert/year \"Simple utility to get the current year with 2 or 4 digits.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 14 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 5 | [doowb](https://github.com/doowb) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 12, 2018._","_attachments":{},"homepage":"https://github.com/jonschlinkert/pretty-time","bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT"}