{"_id":"pretty-time","_rev":"14-3be209a160e8e4bc1a9d2763a980daf2","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"},"versions":{"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":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"6e0a7f78dffd12bd6ece915d03c00ab23d447180","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-0.1.0.tgz","integrity":"sha512-6/6VhE8v5nUetfUqmZkunWNv7w2u4cFQq4lnjgy5AJf0kCgjThJ7YMgGaVIO0t+UrM4+VHVb5QVZ3pmvmVrolw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLjftGQ3LB9WvX+UH8UXbEiPa8WlsSo/NWiWkNRJhAtAiEApJPe1ohDCF84MQMVKyCUrGOJZnXQD3GNPeSFu/6Zra8="}]},"directories":{}},"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":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"dcac121c2adce2512e159626892f0d7d99c761db","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-0.1.1.tgz","integrity":"sha512-dcstuY47K8a1XQj4fPmygmxS7oX6pUXAHBqh+glQzgPdh9HbSJpNrcCby7HyUTqdzMUm8Fbbit9bWwdecWx+WA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6ndv7q07/m0GHYQI3xF08pxxV2abyKektT7hBBYS7gAIgfIgypFe6Y1oQ1hqYxc8U9qYTKiQqg2/JLFP1oX5uaWo="}]},"directories":{}},"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":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"c1b92b1bc5d2c04ee54be3c91342490ab8baf38e","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-0.1.2.tgz","integrity":"sha512-gKkAsUabgz6mOz66JYw9xg+RYYy03vMpm3lUMMbP7ER3aGt3J/Z5v8DycceDi/PepYaqt0/t5nJP1fwOHRbp5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwt9q8XkDbD9Pi0K5pDzzsLBIphevVVabzQg+v+b9XxAIgMkq0frjk3/vymeiUZVxACpCzVwkoX362s8PqZursbeY="}]},"directories":{}},"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","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-0.2.0.tgz","integrity":"sha512-BwYVCPtnSq3nIGDK2rgwZTN2ClhBQmnG8pudrXIfGBwuMutIBj/W7wm/jz1WCHl/Kk2Q5i1Am1uD2Q74oPyBCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCDqnEbO6ZB21tp+pBQCCozjQWpnGw7Ws0DdBDZgwk7AiEAnJRSMZNECyUJSTACjP6/Wyb21o0OhE1+bKTCdWkBkWI="}]},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{}},"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":{"integrity":"sha512-+8bAuWoeG7CBA4Yz5NrcN8NyjD86YcrlxquWlYRLgfwxzXtbHXUnPWeXW5jzTsBwaEf89KNM0luWnRXh6l02EA==","shasum":"544784adecaa2cd7d045ff8a8f1d4791c8e06e23","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-1.0.0.tgz","fileCount":5,"unpackedSize":10134,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxbxDKfntZzVi9I98TmF8HUkKH4RwLK/pnGxQo+xVW1AIhAKNd59LMuJ9FLXu6i5Jx+b9p8Gg5kWbm7mUzxQBW7PUd"}]},"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},"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":{"integrity":"sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==","shasum":"ffb7429afabb8535c346a34e41873adf3d74dd0e","tarball":"https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz","fileCount":5,"unpackedSize":10045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbR43bCRA9TVsSAnZWagAAqMgP/jprBUtBoTe7JGivS8Bd\nbhqWvLPiAN5oFG3FGxAm4hvrZl2z90ixPQOspv2HsSCUytSXb8Wi2TbcDpz0\nTw0G9sS+qZYS3qpPyzDwMTHXzFsFowD4Nck/6g79UljlDZnDfHSK1/1RcvkM\nnvuCHUKtA7vSDZz4r1J5/F9UeToTCBgU1SFF0TBXAEjo9KF+/ve2RzZd6MX0\naOEAg1l0/I1p5BAkDfIP+vsRtUF7Y7IvXnQhG8E5pp0CYPJcSsewE4EmbCLH\n4kb4t2YIjr1sekAhjnYFnNEOZu3ufnmHJIHA92KJJonaeQaAjqc7CWBg/ANt\nrFQGyhcn1UOdpDWTAmT6XM6JloXBGuMuWWyvGxU7iaIIF/uISPcuCzvdWoso\nbF8f3SV9O1+rVn0bLi1Rv2iYw1BklnAc3CcwFqF70qRs37ASMhXJDBNWfA2o\n6bOJ8Fb/G1SnAVWarbvodkyzLXpBu3J6AAnX6q3Ch8T/FqysNDnmfHQsco1/\nXmwh4/2h3r/dEYjiqEnGkzsrTbTfcuLohLEm5m9Gmtiw+ZMPfiq7ImvvuWGx\n3bAt7J7XuNzWC2Ex3A7sqBuSA7S+mnAPHVfgqs3bIlvv1+vowqv1++29gDFJ\nawi0JRUv9d7iw2rCAXLH65ivngqP2z+MpmFjyOgFF1JpugrsR/YrOchKAL6X\nXY+h\r\n=3tCf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrrKYrTvQBxvyGDUdlE2NlLKm4kr9MY3otbW4Gls4n6wIhAMv8wJuyzvNA6++UAr8TxZ0hrkihTVWodl3hPQxgHAdA"}]},"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}},"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._","maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2022-06-24T15:01:05.940Z","created":"2015-10-12T09:33:44.566Z","0.1.0":"2015-10-12T09:33:44.566Z","0.1.1":"2015-10-18T09:14:48.894Z","0.1.2":"2015-10-18T09:16:48.236Z","0.2.0":"2015-10-21T00:38:42.310Z","1.0.0":"2018-03-19T19:33:37.408Z","1.1.0":"2018-07-12T17:20:27.690Z"},"homepage":"https://github.com/jonschlinkert/pretty-time","keywords":["convert","date","format","formatting","hour","hrtime","micro","milli","minute","nano","nanosecond","pretty","second","time","week"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/pretty-time.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/pretty-time/issues"},"license":"MIT","readmeFilename":"README.md","users":{"joaquin.briceno":true,"arttse":true,"rocket0191":true,"pedromsilva":true}}