{"id":17398428,"url":"https://github.com/vweevers/bruce-millis","last_synced_at":"2025-04-30T05:22:20.244Z","repository":{"id":66220525,"uuid":"282399398","full_name":"vweevers/bruce-millis","owner":"vweevers","description":"Convert various time formats to milliseconds.","archived":false,"fork":false,"pushed_at":"2020-07-25T08:05:58.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-25T01:58:20.622Z","etag":null,"topics":["milliseconds","ms","nodejs","npm-package","time"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-25T08:03:44.000Z","updated_at":"2020-08-15T12:18:32.000Z","dependencies_parsed_at":"2023-03-17T12:00:56.306Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/bruce-millis","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"81eab3c3655651c25a4c5f8f2a1a90599e7659f0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fbruce-millis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fbruce-millis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fbruce-millis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fbruce-millis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/bruce-millis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251645987,"owners_count":21620847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["milliseconds","ms","nodejs","npm-package","time"],"created_at":"2024-10-16T14:56:18.425Z","updated_at":"2025-04-30T05:22:20.213Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bruce-millis\n\n**Convert various time formats to milliseconds.** Same as [`ms`](https://github.com/vercel/ms) except it only does parsing, which gives us the opportunity to return a number input as-is. I frequently did:\n\n```js\nconst ms = require('ms')\nconst timeout = typeof n === 'number' ? n : ms(n)\n```\n\n[![npm status](http://img.shields.io/npm/v/bruce-millis.svg)](https://www.npmjs.org/package/bruce-millis)\n[![node](https://img.shields.io/node/v/bruce-millis.svg)](https://www.npmjs.org/package/bruce-millis)\n[![Travis build status](https://img.shields.io/travis/com/vweevers/bruce-millis.svg?label=travis)](http://travis-ci.com/vweevers/bruce-millis)\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')\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```\n\n## API\n\n### `ms(value)`\n\nThe `value` argument is required and must be a string or a number (returned as-is). String values are parsed exactly like [`ms`](https://github.com/vercel/ms). If the input is invalid, NaN is returned. If you want an error to be thrown, see [`bruce-millis-option`](https://github.com/vweevers/bruce-millis-option).\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install bruce-millis\n```\n\n## License\n\n[MIT](LICENSE.md). Adapted from [`ms`](https://github.com/vercel/ms), please see license for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fbruce-millis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fbruce-millis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fbruce-millis/lists"}