{"versions":{"2.0.0":{"umd:name":"ms","version":"2.0.0","name":"@lukeed/ms","repository":{"type":"git","url":"git+https://github.com/lukeed/ms.git"},"description":"A tiny (414B) and fast utility to convert milliseconds to and from strings.","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"keywords":["ms","time","format","milliseconds","convert"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"b2d295408f18bfd47a43ebf4de5e6ce21468e7d0","bugs":{"url":"https://github.com/lukeed/ms/issues"},"homepage":"https://github.com/lukeed/ms#readme","_id":"@lukeed/ms@2.0.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"shasum":"cacd4fcb81b1b285f21f8c7e3650874ef9383f1b","size":3716,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lukeed/ms/-/ms-2.0.0.tgz","integrity":"sha512-NOlhE40rGptwLwJhE0ZW259hcoa+nkpQRQ1FUKV4Sr2z1Eh2WfkHQ3jjBNF7YEqOrF0TOpqnyU1wClvWBrXByg=="},"_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ms_2.0.0_1614752318451_0.8486867137091219"},"_hasShrinkwrap":false,"publish_time":1614752318590,"_cnpm_publish_time":1614752318590,"_cnpmcore_publish_time":"2021-12-17T00:23:21.365Z","contributors":[]},"1.0.0":{"version":"1.0.0","name":"@lukeed/ms","repository":{"type":"git","url":"git+https://github.com/lukeed/ms.git"},"description":"A tiny (408B) and fast utility to convert milliseconds to and from strings.","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"ms.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=8"},"scripts":{"build":"bundt","pretest":"npm run build","test":"tape -r esm test/*.js | tap-spec"},"keywords":["ms","time","format","milliseconds","convert"],"devDependencies":{"bundt":"1.0.0","esm":"3.2.25","tap-spec":"5.0.0","tape":"4.9.1"},"gitHead":"a6bb04bdd31c46cd6b6c927d9dfd10d3b94095d2","bugs":{"url":"https://github.com/lukeed/ms/issues"},"homepage":"https://github.com/lukeed/ms#readme","_id":"@lukeed/ms@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"dist":{"shasum":"dea9fa553c8119e108ee7aa6e563e49abe6d3e10","size":3657,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lukeed/ms/-/ms-1.0.0.tgz","integrity":"sha512-98Rlnyqp9w3rY/ErihFZ8am4WTrhqsthktQ7Tf2BUQQquaEVu2mUMdhzBhtG02AZfTcLY3ZfFR1FG7VfPNgJdA=="},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ms_1.0.0_1584383447474_0.2580366446969"},"_hasShrinkwrap":false,"publish_time":1584383447558,"_cnpm_publish_time":1584383447558,"_cnpmcore_publish_time":"2021-12-17T00:23:21.543Z","contributors":[]},"2.0.1":{"umd:name":"ms","version":"2.0.1","name":"@lukeed/ms","repository":{"type":"git","url":"git+https://github.com/lukeed/ms.git"},"description":"A tiny (414B) and fast utility to convert milliseconds to and from strings.","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"keywords":["ms","time","format","milliseconds","convert"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"e8001e5e5bf7d41450e86a72a2b0dbdc4c1e7d29","bugs":{"url":"https://github.com/lukeed/ms/issues"},"homepage":"https://github.com/lukeed/ms#readme","_id":"@lukeed/ms@2.0.1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==","shasum":"3c2bbc258affd9cc0e0cc7828477383c73afa6ee","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lukeed/ms/-/ms-2.0.1.tgz","fileCount":7,"unpackedSize":9382,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIGhhBLkDd2rtpHBoqsgub3fEmpjxxkUumk+FYQcyc1QIhAMnYzRlFzTh/cLBWKebUMnF97Gt36+IjZw1q5/UCGdAR"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNb9AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrwthAAm9ONfRBZfbldxno9vSqAJD8A04ixRzULKnriBZeejLe0Zjtg\r\n4wJVyVrKgskc/JjP7F4NIyqc+dIaqsurXfuE3bsrpgNLZiQr46xQu/3vF0Pd\r\nr8xXTiw7zvBDSCSUzkOfLFydhRuI8vv6ZKBQUU2GLFy+KzQ0vn1LDBhGjlxN\r\nhLBjUdxCokKUtDJVJmor8Udie8SLPz0nLCIY1hM4Cc8hM/g/YxpZguCkxmdd\r\nKzB7OKsJ25YIhb0Oh+DMYKPnvE71mRl7bZbnPX4Xiwiid9nGOldBq25uBbET\r\niTNK2raixF/Lyf6xIku2RIdcnmAyXWMyz5EJ5++L4nrnHApF7aJHp1RbhN+3\r\nQX0Hb/gGTCSoIWLTjaoXSQklyPSsn23OuWOz4U8j/BD2T6npA9qODwmaXzkJ\r\njDMV7042bkmblAaUMCkQK/lYRqaZpJiX4Ixlv8RKKShPxZaaaRd2VcmS5ZOX\r\n9XlxaNikg+JhvcdCjrjv65CUj0r2PNyp81/oxLjuiePZtUlzbR/0L00yhofc\r\n7A1FlicO5vh/5na5GWVvhCL1VNm/OZEGkK+LocC5vsdCXBWF7xL+l+rh7+JF\r\nlhMrOLbfKvmu7xVG96qOlHXwhaPZftzQvfjmK7LoaUhMr1nqLN2KF0bE0Q99\r\nJIsz2/xWPnapJ2hGCkXM+Y/eo/PDA5mhgfw=\r\n=jxod\r\n-----END PGP SIGNATURE-----\r\n","size":3703},"_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ms_2.0.1_1664466752625_0.5926763898678358"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-29T22:10:00.434Z","contributors":[]},"2.0.2":{"umd:name":"ms","version":"2.0.2","name":"@lukeed/ms","repository":{"type":"git","url":"git+https://github.com/lukeed/ms.git"},"description":"A tiny (414B) and fast utility to convert milliseconds to and from strings.","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"keywords":["ms","time","format","milliseconds","convert"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"_id":"@lukeed/ms@2.0.2","gitHead":"ea01baec0cc2ae2aa7679a7f08ea4b4ee5f9b3e3","bugs":{"url":"https://github.com/lukeed/ms/issues"},"homepage":"https://github.com/lukeed/ms#readme","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==","shasum":"07f09e59a74c52f4d88c6db5c1054e819538e2a8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lukeed/ms/-/ms-2.0.2.tgz","fileCount":7,"unpackedSize":9387,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNf5qD0XnQ+6wv78+HLB1wJUMygQxwUAcm1yP2LdOGswIgJhnZi6yhejmZvRfnOc0EZ/i+7+1wcJJPA64H46kHxD4="}],"size":3704},"_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ms_2.0.2_1701211032846_0.09698399356929066"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-28T22:37:13.145Z","publish_time":1701211033145,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.0.2"},"name":"@lukeed/ms","time":{"created":"2022-01-26T23:29:37.494Z","modified":"2023-11-29T01:13:25.794Z","2.0.0":"2021-03-03T06:18:38.590Z","1.0.0":"2020-03-16T18:30:47.558Z","2.0.1":"2022-09-29T15:52:32.797Z","2.0.2":"2023-11-28T22:37:13.145Z"},"readme":"# ms [![CI](https://github.com/lukeed/ms/workflows/CI/badge.svg)](https://github.com/lukeed/ms/actions) [![codecov](https://badgen.net/codecov/c/github/lukeed/ms)](https://codecov.io/gh/lukeed/ms)\n\n> A tiny (414B) and [fast](#benchmarks) utility to convert milliseconds to and from strings.\n\n---\n\n***NOTICE:** This is a fork of [vercel/ms](https://github.com/vercel/ms)!*<br>\nIn June 2019, I [opened a PR](https://github.com/zeit/ms/pull/120) with signficiant performance and code size improvements. After nearly 2 years of silence, it was eventually closed. :cry: A year into my wait, I started anew (this repo), hoping to improve upon my own improvements.\n\n---\n\nThis module is delivered as:\n\n* **CommonJS**: [`dist/index.js`](https://unpkg.com/@lukeed/ms/dist/index.js)\n* **ES Module**: [`dist/index.mjs`](https://unpkg.com/@lukeed/ms/dist/index.mjs)\n* **UMD**: [`dist/index.min.js`](https://unpkg.com/@lukeed/ms/dist/index.min.js)\n\n## Install\n\n```\n$ npm install --save @lukeed/ms\n```\n\n\n## Usage\n\n```js\nimport { parse, format } from '@lukeed/ms';\n\n// string => number\nparse('2 days');   //=> 172800000\nparse('1d');       //=> 86400000\nparse('10h');      //=> 36000000\nparse('2.5 hrs');  //=> 9000000\nparse('2h');       //=> 7200000\nparse('1m');       //=> 60000\nparse('5s');       //=> 5000\nparse('1y');       //=> 31557600000\nparse('100');      //=> 100\nparse('-3 days');  //=> -259200000\nparse('-1h');      //=> -3600000\nparse('-200');     //=> -200\n\n// number => string\nformat(60000);             //=> '1m'\nformat(2 * 60000);         //=> '2m'\nformat(-3 * 60000);        //=> '-3m'\nformat(parse('10 hours')); //=> '10h'\n\n// number => string (long)\nformat(60000, true);             //=> '1 minute'\nformat(2 * 60000, true);         //=> '2 minutes'\nformat(-3 * 60000, true);        //=> '-3 minutes'\nformat(parse('10 hours'), true); //=> '10 hours'\n```\n\n\n## API\n\n### ms.parse(input)\nReturns: `Number`\n\nParses the input string, returning the number of milliseconds.\n\n#### input\nType: `String`\n\nThe human-readable time string; eg: `10min`, `10m`, `10 minutes`.\n\n\n### ms.format(milli, long?)\nReturns: `Number`\n\nFormats the millisecond count to a human-readable time string.\n\n> **Important:** The output will be rounded to the nearest whole integer.\n\n#### milli\nType: `Number`\n\nThe number of milliseconds.\n\n#### long\nType: `Boolean`<br>\nDefault: `false`\n\nWhether or not the output should use the interval's long/full form; eg `hour` or `hours` instead of `h`.\n\n> **Note:** When `long`, the count and interval will be separated by a single space.<br>Also, when `long`, the interval may be pluralized; eg `1 second` vs `2 seconds`.\n\n\n## Benchmarks\n\n> Running on Node.js v12.18.4\n\n```\nValidation :: parse\n  ✔ lukeed/ms\n  ✔ zeit/ms\n\nBenchmark :: \"parse\"\n  lukeed/ms      x 351,319 ops/sec ±0.31% (96 runs sampled)\n  zeit/ms        x 245,576 ops/sec ±1.66% (94 runs sampled)\n\nBenchmark :: \"parse\" (long)\n  lukeed/ms      x 335,538 ops/sec ±0.50% (94 runs sampled)\n  zeit/ms        x 265,410 ops/sec ±1.72% (95 runs sampled)\n\n\nValidation :: format\n  ✔ lukeed/ms\n  ✔ zeit/ms\n\nBenchmark :: \"format\"\n  lukeed/ms      x 4,109,440 ops/sec ±0.35% (94 runs sampled)\n  zeit/ms        x 3,420,198 ops/sec ±1.61% (94 runs sampled)\n\nBenchmark :: \"format\" (long)\n  lukeed/ms      x 3,402,872 ops/sec ±0.14% (97 runs sampled)\n  zeit/ms        x 1,344,908 ops/sec ±3.68% (96 runs sampled)\n```\n\n\n## Credits\n\nThis is obviously a fork of [zeit/ms](https://github.com/zeit/ms).\n\nI opened a [PR in June 2019](https://github.com/zeit/ms/pull/120) that introduced significant performance gains and code reduction &mdash; it was ignored for nearly two years. This repository is a from-scratch re-implementation that takes the goals of that PR a bit further.\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)","users":{}}