{"id":25936183,"url":"https://github.com/untemps/read-per-minute","last_synced_at":"2025-03-04T01:50:32.237Z","repository":{"id":43835599,"uuid":"331411006","full_name":"untemps/read-per-minute","owner":"untemps","description":"Class to parse a string and return an estimated reading time based on a lang rate","archived":false,"fork":false,"pushed_at":"2024-04-17T07:06:53.000Z","size":283,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-30T16:37:43.131Z","etag":null,"topics":["estimated-reading-time","lang-rate","read-o-meter","reading","reading-time"],"latest_commit_sha":null,"homepage":"","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/untemps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-01-20T19:33:14.000Z","updated_at":"2024-03-27T07:35:41.000Z","dependencies_parsed_at":"2024-04-15T12:59:44.015Z","dependency_job_id":"78e84441-5877-4b7c-92f4-cda9b6d9c7b6","html_url":"https://github.com/untemps/read-per-minute","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untemps%2Fread-per-minute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untemps%2Fread-per-minute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untemps%2Fread-per-minute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/untemps%2Fread-per-minute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/untemps","download_url":"https://codeload.github.com/untemps/read-per-minute/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768273,"owners_count":20017129,"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":["estimated-reading-time","lang-rate","read-o-meter","reading","reading-time"],"created_at":"2025-03-04T01:50:31.697Z","updated_at":"2025-03-04T01:50:32.228Z","avatar_url":"https://github.com/untemps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @untemps/read-per-minute\n\nClass to parse a long text and return an estimated reading time based on a lang rate.\n\n![npm](https://img.shields.io/npm/v/@untemps/read-per-minute?style=for-the-badge)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/untemps/read-per-minute/index.yml?style=for-the-badge)](https://github.com/untemps/read-per-minute/actions)\n![Codecov](https://img.shields.io/codecov/c/github/untemps/read-per-minute?style=for-the-badge)\n\n## Installation\n\n```bash\nyarn add @untemps/read-per-minute\n```\n\n## Usage\n\nImport `ReadPerMinute`:\n\n```javascript\nimport { ReadPerMinute } from '@untemps/read-per-minute'\n```\n\nCreate an instance of `ReadPerMinute`:\n\n```javascript\nconst rpm = new ReadPerMinute()\n```\n\nCall the `parse` method with a string and a lang (see [Override the value for a one-time parsing](#override-the-value-for-a-one-time-parsing) for an alternative usage):\n\n```javascript\nrpm.parse('Long text', 'en')\n```\n\nThe `parse` function returns an object with the following properties:\n\n| Property | Description\n| -------- | ------------------------------------------------- |\n| time     | The estimated reading time in minutes             |\n| words    | The number of words in the text                   |\n| rate     | The rate value used to calculate the reading time |\n\n## Default Rates\n\nDefault rate values come from [\"How many words do we read per minute? A review and meta-analysis of reading rate\"](https://osf.io/4nv9f/) by Marc Brysbaert - Department of Experimental Psychology Ghent University\n\n| Lang    | Rate |\n| ------- | ---- |\n| default | 200  |\n| ar      | 181  |\n| zh      | 260  |\n| nl      | 228  |\n| en      | 236  |\n| fi      | 195  |\n| fr      | 214  |\n| de      | 260  |\n| he      | 224  |\n| it      | 285  |\n| ko      | 226  |\n| es      | 278  |\n| sv      | 218  |\n\nIf the lang is not listed or is undefined, the default value will be used instead.\n\n## Custom Rates\n\n### Override all the values\n\nYou can specify an entire custom rates object in the constructor of an instance:\n\n```javascript\nconst customRates = {\n\tdefault: 220,\n\tar: 191,\n\tzh: 255,\n\tnl: 234,\n\ten: 244,\n}\nconst rpm = new ReadPerMinute(customRates)\n```\n\n**NOTE**: Set a `default` property in the object if you want the parsing to fallback to a specific value.  \nOtherwise, the static value will be used (`ReadPerMinute.rates.default`).\n\n### Override the value for a one-time parsing\n\nSimply pass the desired custom reading rate in words per minute instead of a language code:\n\n```javascript\n// For very fast readers: 425 words per minute.\nrpm.parse('Long text', 425)\n```\n\n**NOTE**: The custom reading rate must be greater than zero or the default value will be used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funtemps%2Fread-per-minute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funtemps%2Fread-per-minute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funtemps%2Fread-per-minute/lists"}