{"id":13673280,"url":"https://github.com/denolib/ms","last_synced_at":"2025-10-16T02:56:49.857Z","repository":{"id":62421512,"uuid":"162505276","full_name":"denolib/ms","owner":"denolib","description":"Tiny milisecond conversion utility. Ported from https://npmjs.com/ms","archived":false,"fork":false,"pushed_at":"2020-09-15T17:34:13.000Z","size":10,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-11T12:42:01.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/denolib.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}},"created_at":"2018-12-20T00:22:59.000Z","updated_at":"2023-12-16T07:48:31.000Z","dependencies_parsed_at":"2022-11-01T17:31:55.955Z","dependency_job_id":null,"html_url":"https://github.com/denolib/ms","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denolib%2Fms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denolib%2Fms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denolib%2Fms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denolib%2Fms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denolib","download_url":"https://codeload.github.com/denolib/ms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229841253,"owners_count":18132560,"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":[],"created_at":"2024-08-02T10:00:32.507Z","updated_at":"2025-10-16T02:56:44.787Z","avatar_url":"https://github.com/denolib.png","language":"TypeScript","readme":"# `ms`\n[![Build Status](https://travis-ci.org/denolib/ms.svg?branch=master)](https://travis-ci.org/denolib/ms)\n\nUse this package to easily convert various time formats to milliseconds.\nIt is ported from [https://github.com/zeit/ms](https://github.com/zeit/ms) to work with [Deno](https://deno.land). Ported mainly for use in porting `debug`.\n\n## Examples\n\n```js\nimport { ms } from \"https://raw.githubusercontent.com/denolib/ms/master/ms.ts\";\n\nms('2 days')  // 172800000\nms('1d')      // 86400000\nms('10h')     // 36000000\nms('2.5 hrs') // 9000000\nms('2h')      // 7200000\nms('1m')      // 60000\nms('5s')      // 5000\nms('1y')      // 31557600000\nms('100')     // 100\nms('-3 days') // -259200000\nms('-1h')     // -3600000\nms('-200')    // -200\n```\n\n### Convert from Milliseconds\n\n```js\nms(60000)             // \"1m\"\nms(2 * 60000)         // \"2m\"\nms(-3 * 60000)        // \"-3m\"\nms(ms('10 hours'))    // \"10h\"\n```\n\n### Time Format Written-Out\n\n```js\nms(60000, { long: true })             // \"1 minute\"\nms(2 * 60000, { long: true })         // \"2 minutes\"\nms(-3 * 60000, { long: true })        // \"-3 minutes\"\nms(ms('10 hours'), { long: true })    // \"10 hours\"\n```\n\n","funding_links":[],"categories":["基础设施","Uncategorized","Modules","Libraries"],"sub_categories":["Deno 源","Uncategorized","Online Playgrounds","Utils","Assistants"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenolib%2Fms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenolib%2Fms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenolib%2Fms/lists"}