{"id":24590924,"url":"https://github.com/matthewcaseres/pomodoroble","last_synced_at":"2025-07-22T17:03:21.897Z","repository":{"id":57327298,"uuid":"339254429","full_name":"MatthewCaseres/pomodoroble","owner":"MatthewCaseres","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-21T01:35:42.000Z","size":579,"stargazers_count":18,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T05:06:28.521Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatthewCaseres.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,"zenodo":null}},"created_at":"2021-02-16T01:28:34.000Z","updated_at":"2025-04-09T13:01:58.000Z","dependencies_parsed_at":"2025-04-30T08:58:03.839Z","dependency_job_id":"27495cf0-a841-4b7e-9438-9288502988ac","html_url":"https://github.com/MatthewCaseres/pomodoroble","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MatthewCaseres/pomodoroble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewCaseres%2Fpomodoroble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewCaseres%2Fpomodoroble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewCaseres%2Fpomodoroble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewCaseres%2Fpomodoroble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthewCaseres","download_url":"https://codeload.github.com/MatthewCaseres/pomodoroble/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewCaseres%2Fpomodoroble/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266535695,"owners_count":23944275,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-01-24T09:44:31.365Z","updated_at":"2025-07-22T17:03:21.864Z","avatar_url":"https://github.com/MatthewCaseres.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pomodoroble\n\n## About\n\nThis is a programmable timer that returns detailed user data in JSON format. \n\nTraditionally you might enter some data in a CLI prompt. With this timer you import the timer function and write a script with custom logic for generating your configuration and saving the data.\n\nYou can leverage TypeScript to enforce data quality and improve the user experience.\n\n## Simple timers\n\n### Make a file\n\nStart a new Node.js project, install pomodoroble, and make a file `index.js` with the following contents.\n\n```js\nvar {pomodoro} = require(\"pomodoroble\");\n\n(async () =\u003e {\n  let logs = await pomodoro([\n    {activity: \"coding\", h: 1, m: 30, s: 30},\n    {activity: \"break\", m: 10, finishUnder: true},\n    {activity: \"coding\", h: 1},\n  ]);\n  console.log(logs)\n  process.exit()\n})();\n```\n\n### Run the code\n\nThe `pomodoro` method runs a timer. Run `node index.js` to execute the code above.\n\n![](./images/running-time.png)\n\n### Interactions\n\nIn the first coding block I coded for 8 seconds. I then pressed `3` on my keyboard to indicate that my focus was 3 on a scale from 0 to 9. **To move the timer from one interval to the next you press a key 0-9**, which is recorded as the `focus` field in the recorded JSON.\n\nOnce the required time passes the timer goes from red to green. When the `finishUnder` attribute is true, the timer starts at green and turns red when you go over time.\n\nYou can escape the process without recording by pressing `ctrl+c`\n\n### Recording data\n\nWhen you enter a number for the final timer it finishes `await`ing your call to `pomodoro`, logs the logs, and exits.\n\nThe numbers you entered are now your `focus` ratings. The `start` and `end` field are ISO strings that record the start and end time of the activity interval.\n\nI recommend saving these off to somewhere (file system, server) in a format that is convenient (JSON, CSV, etc.).\n\n```js\n[\n  {\n    activity: 'coding',\n    start: 2021-03-03T23:02:18.820Z,\n    end: 2021-03-03T23:02:26.963Z,\n    focus: 3,\n    goalSeconds: 5430,\n    loggedSeconds: 8.143\n  },\n  {\n    activity: 'break',\n    finishUnder: true,\n    start: 2021-03-03T23:02:26.963Z,\n    end: 2021-03-03T23:14:36.559Z,\n    focus: 4,\n    goalSeconds: 600,\n    loggedSeconds: 729.596\n  },\n  {\n    activity: 'coding',\n    start: 2021-03-03T23:14:36.559Z,\n    end: 2021-03-03T23:14:41.960Z,\n    focus: 5,\n    goalSeconds: 3600,\n    loggedSeconds: 5.401\n  }\n]\n```\n\n## pomodoroMaker\n\nThis is a utility function to create patterns of timers.\n\n```js\nvar { pomodoro, pomodoroMaker } = require(\"pomodoroble\");\n//6 1hr intervals of code\nconst intervals = pomodoroMaker({\n  activity: \"code\",\n  blocks: 6,\n  blockLength: { h: 1 },\n  breakLength: { m: 10 },\n});\n// Give ourselves a lunch\nintervals[3] = { activity: \"lunch\", m: 40, finishUnder: true };\n\n(async () =\u003e {\n  let logs = await pomodoro(intervals);\n  console.log(logs);\n  process.exit();\n})();\n```\n\n![](./images/lunch.png)\n\n## TypeScript\n\nYou can see how I'm currently using the software in `usage/scripts`. At time of writing it looks roughly like this:\n\n![](./images/ts-error.png)\n\nBoth `pomodoro` and `pomodoroMaker` take a generic that will type the `activity` parameter. This provides both data validation (see image above) and auto-completion.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewcaseres%2Fpomodoroble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewcaseres%2Fpomodoroble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewcaseres%2Fpomodoroble/lists"}