{"id":16032840,"url":"https://github.com/silverwind/timerel","last_synced_at":"2025-03-17T21:30:36.103Z","repository":{"id":50530166,"uuid":"519336215","full_name":"silverwind/timerel","owner":"silverwind","description":"Teeny-tiny relative date formatting","archived":false,"fork":false,"pushed_at":"2024-04-13T19:12:01.000Z","size":826,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T09:49:35.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-07-29T20:02:03.000Z","updated_at":"2024-05-03T01:26:15.473Z","dependencies_parsed_at":"2023-02-14T02:02:02.934Z","dependency_job_id":"1de72f47-c882-4213-b36e-1d43e2748399","html_url":"https://github.com/silverwind/timerel","commit_stats":{"total_commits":71,"total_committers":1,"mean_commits":71.0,"dds":0.0,"last_synced_commit":"406542005ffda5068db36c2922343377cd64e297"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ftimerel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ftimerel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ftimerel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ftimerel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverwind","download_url":"https://codeload.github.com/silverwind/timerel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885927,"owners_count":20363644,"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-10-08T21:40:50.651Z","updated_at":"2025-03-17T21:30:35.793Z","avatar_url":"https://github.com/silverwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timerel\n[![](https://img.shields.io/npm/v/timerel.svg?style=flat)](https://www.npmjs.org/package/timerel) [![](https://img.shields.io/npm/dm/timerel.svg)](https://www.npmjs.org/package/timerel) [![](https://img.shields.io/bundlephobia/minzip/timerel.svg)](https://bundlephobia.com/package/timerel) [![](https://packagephobia.com/badge?p=timerel)](https://packagephobia.com/result?p=timerel)\n\n`timerel` formats dates to short english relative format `5 mins ago` and does so around [11 times faster](./bench.ts) than [its competition](https://github.com/hustcc/timeago.js).\n\n## Usage\n\n```ts\nimport {timerel} from \"timerel\";\n\nconsole.log(timerel(Date.now() - 1e6));\n// =\u003e 16 mins ago\n```\n\n## API\n### timerel(date, opts?)\n\n- `date` *String, Number or Date*: The date to format.\n\n#### Options\n\n- `now` *String, Number or Date*: The date to compare to. Default: `Date.now()`.\n- `noAffix` *Boolean*: Whether to omit `ago` and `in` affixes. Default: `false`.\n- `times` *Array*: A custom time table that overrides the built-in one.\n- `nowThreshold` *Number*: Number of milliseconds below which to output `\"now\"`. Default: 2000.\n- `nowString` *String*: String to output for now. Default: `\"now\"`.\n- `unknownString` *String*: String to output for invalid dates. Default: `String(date)`.\n- `aliases` *Boolean*: Use aliases like \"yesterday\" instead of \"1 day ago\". Default: `false`.\n- `aliasesMap` *Object*: A custom aliases object to use instead of the built-in one.\n- `longUnits` *Boolean*: Use minutes/secoonds instead of mins/secs. Default: `false`.\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Ftimerel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverwind%2Ftimerel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Ftimerel/lists"}