{"_id":"bruce-millis-option","_rev":"1-e428c3c768f6dc865492f25f4720c321","name":"bruce-millis-option","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"bruce-millis-option","version":"1.0.0","description":"Convert various time formats to milliseconds and throw if result is NaN","license":"MIT","author":{"name":"Vincent Weevers"},"scripts":{"test":"standard && hallmark && nyc node test"},"dependencies":{"bruce-millis":"^1.0.0"},"devDependencies":{"hallmark":"^2.1.0","nyc":"^15.1.0","standard":"^14.3.4","tape":"^5.0.1"},"keywords":["milliseconds","ms","parse","time"],"repository":{"type":"git","url":"git+https://github.com/vweevers/bruce-millis-option.git"},"bugs":{"url":"https://github.com/vweevers/bruce-millis-option/issues"},"homepage":"https://github.com/vweevers/bruce-millis-option","engines":{"node":">=8"},"gitHead":"bcd6712a5326c400104e95bea52447063f7bf623","_id":"bruce-millis-option@1.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","_npmUser":{"name":"vweevers","email":"dev@vincentweevers.nl"},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"dist":{"integrity":"sha512-CJOBham7dfRAU97F7vmGEmNXcSkK0GlDV+0QqsaVUu7cH/LO4I/y80j1GWX7MasKJMo6zQU2oCuTRl/ko2kyQA==","shasum":"d2247d576d7593d5644853c08244934283dc6300","tarball":"https://registry.npmjs.org/bruce-millis-option/-/bruce-millis-option-1.0.0.tgz","fileCount":4,"unpackedSize":4014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfG+kLCRA9TVsSAnZWagAAA4sP/RTSkREbAMUy7AXoMlAZ\nN9hKxBzHRSyYpTLPJM+axKIsZo4MWMaYyYppcfRXqwkCijfEmNqlQ2DHHNUP\nSRNBvCp4p1QMQ4mpP0h5sExsBXmAntbejuk2o1IyA46E94mvyGOo02Gaakd7\nOJq5Njd/gd5EQy+s9qjVNKqVQ1UJY2x8xNgfX0kcmq0RhcTl+uAT8kGlXQG5\ng9Ootoefd3d9+3mHa+6CBk4gd+Pdl/euAqNyTPsAEcAQHE1n/vXSHPq35zCC\n0wkq3tqil4poHplqo0ScUXaXoIEVb7/SE9DW4WM4CljdwbIhjTTml1QGRuSJ\n2aA3L0hJgrphJs0VjUcnS1Znlz2kNjmvR3XLxBCATn2XEkTnEv1PqSVB4hIb\n2fQYB0tcZA6DAXoY/gwBaQJCjccLkmK/d0deOoLVP8B6qWrFfL2M4dbom4Ur\nWUQoJlsLuZWCK90O+QKyn5owxO0GF6IqF7sB+/ivCh7ZlnXnD0wkQ2DahtBJ\ni27Eruv3ZfHsAEedRuTEv0x8VtkjFMQyCiMIn3kR+KMBYNyXJ9Ah7PrfI7vE\nW6wpYoRpEGcpfLiEbVs89txnBq/a7LTKyqj4foyTYViLi4gW+zkbqVWmB00Z\n3DRyFDsTDzOudaXcNKL0zgWNHeQ2qKNTeP/FOjjKsUkOoK2ldPvIOSvBhdQj\nhq2L\r\n=pMSK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFfOihxUCywYDllhRxvzrRhJZCU0FwzGsXF6BJbOzSKgIgbYx1QVwG3TarVLK8Mvr4uiay8jOIvYkoZ/Gu56q0yeI="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bruce-millis-option_1.0.0_1595664650608_0.6621042533868582"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-25T08:10:50.608Z","1.0.0":"2020-07-25T08:10:50.757Z","modified":"2022-04-12T04:31:05.883Z"},"maintainers":[{"name":"vweevers","email":"dev@vincentweevers.nl"}],"description":"Convert various time formats to milliseconds and throw if result is NaN","homepage":"https://github.com/vweevers/bruce-millis-option","keywords":["milliseconds","ms","parse","time"],"repository":{"type":"git","url":"git+https://github.com/vweevers/bruce-millis-option.git"},"author":{"name":"Vincent Weevers"},"bugs":{"url":"https://github.com/vweevers/bruce-millis-option/issues"},"license":"MIT","readme":"# bruce-millis-option\n\n**Convert various time formats to milliseconds and throw if result is `NaN`. Like [`bruce-millis`](https://github.com/vweevers/bruce-millis) but dies harder.**\n\n[![npm status](http://img.shields.io/npm/v/bruce-millis-option.svg)](https://www.npmjs.org/package/bruce-millis-option)\n[![node](https://img.shields.io/node/v/bruce-millis-option.svg)](https://www.npmjs.org/package/bruce-millis-option)\n[![Travis build status](https://img.shields.io/travis/com/vweevers/bruce-millis-option.svg?label=travis)](http://travis-ci.com/vweevers/bruce-millis-option)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Usage\n\n```js\nconst ms = require('bruce-millis-option')\n\nms(24)        // 24\nms('5s')      // 5000\nms('1m')      // 60000\nms('2h')      // 7200000\nms('2.5 hrs') // 9000000\nms('10h')     // 36000000\nms('1d')      // 86400000\nms('2 days')  // 172800000\nms('1y')      // 31557600000\nms('-3 days') // -259200000\nms('-1h')     // -3600000\n\nms('invalid') // throws TypeError\n```\n\n## API\n\n### `ms(value[, hint])`\n\nParses `value` with [`bruce-millis`](https://github.com/vweevers/bruce-millis), throws a TypeError if result is `NaN`. A `hint` may be provided to customize the error message:\n\n```js\nms(options.timeout, 'The timeout option')\n```\n\n```\n$ node example.js\n/example/node_modules/bruce-millis-option/index.js:11\n    throw new TypeError(\n    ^\n\nTypeError: The timeout option must be a number in milliseconds or a string with unit (e.g. '5m')\n    at module.exports (/example/node_modules/bruce-millis-option/index.js:11:11)\n    at Object.<anonymous> (/example/example.js:2:1)\n    at ..\n```\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install bruce-millis-option\n```\n\n## License\n\n[MIT](LICENSE.md) © 2020-present Vincent Weevers\n","readmeFilename":"README.md"}