{"id":13459467,"url":"https://github.com/renatorib/typed-ms","last_synced_at":"2025-08-17T11:11:51.156Z","repository":{"id":239801872,"uuid":"800724888","full_name":"renatorib/typed-ms","owner":"renatorib","description":"🕰️ Typed, human-readable time to milliseconds converter","archived":false,"fork":false,"pushed_at":"2024-07-26T18:12:49.000Z","size":75,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T17:59:39.739Z","etag":null,"topics":["human-readable","human-readable-time","milliseconds","ms","time","typed","typed-ms"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/renatorib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-14T21:57:04.000Z","updated_at":"2024-11-16T03:55:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"20e92eb4-1acf-47a9-84af-77c70c82470e","html_url":"https://github.com/renatorib/typed-ms","commit_stats":null,"previous_names":["renatorib/typed-ms"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/renatorib/typed-ms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatorib%2Ftyped-ms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatorib%2Ftyped-ms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatorib%2Ftyped-ms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatorib%2Ftyped-ms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renatorib","download_url":"https://codeload.github.com/renatorib/typed-ms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renatorib%2Ftyped-ms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837583,"owners_count":24654391,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["human-readable","human-readable-time","milliseconds","ms","time","typed","typed-ms"],"created_at":"2024-07-31T10:00:17.603Z","updated_at":"2025-08-17T11:11:51.147Z","avatar_url":"https://github.com/renatorib.png","language":"TypeScript","funding_links":[],"categories":["Date \u0026 Time"],"sub_categories":[],"readme":"# Typed MS\n\nGet milliseconds from human readable time code.  \nNo more typos, it's type-safe!\n\n### Install\n\n```bash\nnpm add typed-ms\n```\n\n### Usage\n\n```ts\nimport { ms } from \"typed-ms\";\n\n// From typed string\nms(\"2 h\"); // -\u003e 7200000\nms(\"2 hours\"); // -\u003e 7200000\nms(\"2 h\", \"30 m\"); // -\u003e 9000000\nms(\"2 hr\", \"30 min\"); // -\u003e 9000000\nms(\"2 hours\", \"30 minutes\"); // -\u003e 9000000\nms(\"2.5 h\"); // =\u003e 9000000\nms(\"2 hurs\"); // Fail: type error!\n\n// From direct tokens/aliases functions\nms.hours(2); // -\u003e 7200000\nms.hours(2.5); // -\u003e 9000000\nms.hours(2) + ms.minutes(30); // -\u003e 9000000\nms.h(2) + ms.m(30); // -\u003e 9000000\nms.hr(2) + ms.min(30); // -\u003e 9000000\n\n// From direct tokens\nms.from({ hours: 2, minutes: 30 }); // -\u003e 9000000\n```\n\n### Functions\n\n```ts\nms.seconds(1);\nms.second(1);\nms.sec(1);\nms.s(1);\n\nms.minutes(1);\nms.minute(1);\nms.min(1);\nms.m(1);\n\nms.hours(1);\nms.hour(1);\nms.hr(1);\nms.h(1);\n\nms.days(1);\nms.day(1);\nms.d(1);\n\nms.weeks(1);\nms.week(1);\nms.w(1);\n\nms.months(1);\nms.month(1);\nms.mo(1);\n\nms.years(1);\nms.year(1);\nms.y(1);\n```\n\n### `from` options:\n\nFrom options only work with tokens, they won't work with aliases (like `h`, `sec`, etc.)\n\n```ts\nms.from({\n  seconds: 1,\n  minutes: 1,\n  hours: 1,\n  days: 1,\n  weeks: 1,\n  months: 1,\n  years: 1,\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatorib%2Ftyped-ms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenatorib%2Ftyped-ms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenatorib%2Ftyped-ms/lists"}