{"id":16644138,"url":"https://github.com/devxprite/times-ago","last_synced_at":"2025-10-30T12:30:29.569Z","repository":{"id":207323608,"uuid":"718935859","full_name":"devxprite/timesAgo","owner":"devxprite","description":" convert timestamps into human-readable time ago statements","archived":false,"fork":false,"pushed_at":"2023-11-20T16:21:15.000Z","size":26,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T08:31:50.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/timesago","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/devxprite.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}},"created_at":"2023-11-15T04:58:07.000Z","updated_at":"2024-12-23T11:45:02.000Z","dependencies_parsed_at":"2023-11-20T16:38:35.659Z","dependency_job_id":null,"html_url":"https://github.com/devxprite/timesAgo","commit_stats":null,"previous_names":["devxprite/timesago"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2FtimesAgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2FtimesAgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2FtimesAgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devxprite%2FtimesAgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devxprite","download_url":"https://codeload.github.com/devxprite/timesAgo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238961323,"owners_count":19559468,"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-12T08:10:32.804Z","updated_at":"2025-10-30T12:30:29.198Z","avatar_url":"https://github.com/devxprite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## timesago\n\n`timeago` is a simple \u0026 lightweight js library that make it easy to convert timestamps into human-readable time ago statements (eg. '2 hours ago' or 'in 3 days.')\n\n## Installation\n\n### CDN\nInclude timesago directly in your HTML file using a CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/timesago@1\"\u003e\u003c/script\u003e\n```\n\n### Package manager\n\n```bash\nnpm install timesago\n```\nOnce the package is installed, you can import the library using import:\n\n```bash\nimport timesago from 'timesago'\n```\nIf you use require for importing: \n\n```bash\nconst timesago = require('timesago');\n```\n\n## Usage\nYou can pass any ISO 8601 formatted dates to the timesago function. \n\n```javascript\nconst result1 = timesago('October 19, 2002');\nconsole.log(result1); // 21 years ago\n\nconst result2 = timesago(1386786600000);\nconsole.log(result2); // 9 years ago\n\nconst result3 = timesago(Date.now() - 3 * 24 * 60 * 60 * 1000);\nconsole.log(result3); // 3 days ago\n\nconst result4 = timesago('2050-01-15T12:30:00Z');\nconsole.log(result4); // in 26 years\n```\n\n## API\n\n`timesago(timestamp, options)`\n\n- `timestamp`: _(number, string, or Date object)_: The timestamp to convert to a time ago format. Accepted formats include:\n\n    - A number representing milliseconds since the Unix epoch.\n    - A string in ISO 8601 format (e.g., '2023-01-15T12:30:00Z').\n    - A JavaScript Date object.\n\n- `options`: _(object, optional)_: An optional object with configuration options. Default options are:\n```javascript\n{\n    now: Date.now(), // current timestamp\n    prefixFromNow: 'in', \n    suffixAgo: 'ago',\n    justNow: 'just now',\n    blank: '',\n}\n```\n\n## Contributing\nFeel free to contribute. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.\n\n## License\nThis project is licensed under the `MIT License` - see the [LICENSE.md](./LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxprite%2Ftimes-ago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevxprite%2Ftimes-ago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevxprite%2Ftimes-ago/lists"}