{"id":21089306,"url":"https://github.com/f3rno64/time-speak","last_synced_at":"2025-05-16T12:32:02.608Z","repository":{"id":209406773,"uuid":"722770152","full_name":"f3rno64/time-speak","owner":"f3rno64","description":"A natural language parser for dates, times and intervals.","archived":false,"fork":false,"pushed_at":"2024-02-07T23:24:44.000Z","size":2873,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T12:13:01.136Z","etag":null,"topics":["dates-and-times","natural-language-parser","node-library","parser","utility"],"latest_commit_sha":null,"homepage":"https://f3rno64.github.io/time-speak/","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/f3rno64.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-23T23:00:58.000Z","updated_at":"2025-03-20T03:48:31.000Z","dependencies_parsed_at":"2023-11-27T07:36:00.578Z","dependency_job_id":"8d1b5074-61ad-4f91-acc9-f8710409a737","html_url":"https://github.com/f3rno64/time-speak","commit_stats":null,"previous_names":["f3rno64/time-speak"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Ftime-speak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Ftime-speak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Ftime-speak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f3rno64%2Ftime-speak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f3rno64","download_url":"https://codeload.github.com/f3rno64/time-speak/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254530298,"owners_count":22086583,"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":["dates-and-times","natural-language-parser","node-library","parser","utility"],"created_at":"2024-11-19T21:28:17.452Z","updated_at":"2025-05-16T12:31:57.580Z","avatar_url":"https://github.com/f3rno64.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A natural language parser for dates, times, and durations\n\n\u003e time-speak\n\n[![NPM Version][npm-image]][npm-url]\n[![Downloads Stats][npm-downloads]][npm-url]\n\nA tiny utility library **with no dependencies** that parses natural language\n**dates**, **times**, and **intervals** to either a `Date` instance or a\nnumerical value in milliseconds. Here are some examples of possible inputs:\n\n- **'two weeks ago'**\n- **'1 day ago'**\n- **'in 2 hours and 5 minutes'**\n- **'in a month'**\n- **'2018-01-01T00:00:00.000Z'**\n\n## Installation\n\nInstall it with your package manager of choice; for example, with *pnpm*:\n\n```bash\npnpm add time-speak\n```\n\n## Usage\n\n\u003e [!TIP]\n\u003e Inputs can be written in plain english! Examples of valid values are\n\u003e 'in twenty minutes', '2 days ago', and '1 hour and 23 minutes ago'.\n\nImport the `parse` function call it with a string containing a\n*natural language* representation of either a time in the **future**, **past**,\nor a **numeric duration**. The return value is a timestamp in **milliseconds**\nif the input is a **duration**, otherwise it is a **`Date`** instance.\n\n```js\nimport { parse } from 'time-speak'\n\nconst pastDate = parse('2 days and 4 hours ago')\nconst pastDateWithNumberWords = parse('two days and four hours ago')\nconst futureDate = parse('in 4 hours')\nconst durationMS = parse('6 months')\n\nconsole.log({\n  pastDateWithNumberWords, // 2023-12-19T13:02:39.768Z\n  pastDate, // 2023-12-19T13:02:39.768Z\n  futureDate, // 2023-12-21T21:02:39.768Z\n  durationMS // 15552000000\n})\n```\n\n## API Reference\n\nThe standalone JSDoc-generated documentation can be found in\n[**DOCUMENTATION.md**](/DOCUMENTATION.md).\n\n## Release History\n\nSee [**CHANGELOG.md**](/CHANGELOG.md) for more information.\n\n## License\n\nDistributed under the **MIT** license. See [**LICENSE.md**](/LICENSE.md) for\nmore information.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n[npm-image]: https://img.shields.io/npm/v/time-speak.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/time-speak\n[npm-downloads]: https://img.shields.io/npm/dm/time-speak.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3rno64%2Ftime-speak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff3rno64%2Ftime-speak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff3rno64%2Ftime-speak/lists"}