{"id":15881513,"url":"https://github.com/bartlomiejzuber/use-cron-parser","last_synced_at":"2026-05-02T19:34:07.274Z","repository":{"id":57387962,"uuid":"398749553","full_name":"bartlomiejzuber/use-cron-parser","owner":"bartlomiejzuber","description":"Useful \u0026 super tiny (\u003c5KB ✔️) hook for cron expression handling in React","archived":false,"fork":false,"pushed_at":"2022-02-11T15:49:49.000Z","size":1098,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T16:03:42.696Z","etag":null,"topics":["cron","hook","parser","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/bartlomiejzuber.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}},"created_at":"2021-08-22T08:22:49.000Z","updated_at":"2023-11-08T09:04:41.000Z","dependencies_parsed_at":"2022-09-05T03:10:31.203Z","dependency_job_id":null,"html_url":"https://github.com/bartlomiejzuber/use-cron-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bartlomiejzuber/use-cron-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartlomiejzuber%2Fuse-cron-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartlomiejzuber%2Fuse-cron-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartlomiejzuber%2Fuse-cron-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartlomiejzuber%2Fuse-cron-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartlomiejzuber","download_url":"https://codeload.github.com/bartlomiejzuber/use-cron-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartlomiejzuber%2Fuse-cron-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32547649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cron","hook","parser","react","typescript"],"created_at":"2024-10-06T03:42:03.594Z","updated_at":"2026-05-02T19:34:07.256Z","avatar_url":"https://github.com/bartlomiejzuber.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## use-cron-parser\n\n![react hook](https://badgen.net/badge/icon/react-hook?icon=libraries\u0026label)\n![fully typed](https://badgen.net/badge/icon/fully-typed?icon=typescript\u0026label) \n[![npm](https://img.shields.io/npm/v/use-cron-parser.svg)](https://www.npmjs.com/package/use-cron-parser)\n[![Build Status](https://circleci.com/gh/bartlomiejzuber/use-cron-parser/tree/master.svg?style=svg)](https://circleci.com/gh/bartlomiejzuber/use-cron-parser/tree/master)\n[![License](https://badgen.net/github/license/bartlomiejzuber/use-cron-parser)](https://github.com/bartlomiejzuber/use-cron-parser/blob/master/LICENSE)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/d360c27d-3707-4eb8-a0bd-b6e0d65a3e22/deploy-status)](https://app.netlify.com/sites/use-cron-parser-demo/deploys)\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/bartlomiejzuber/use-cron-parser/master/assets/icon.jpeg\" alt=\"hook icon\"/\u003e\n\u003c/p\u003e\n\nUseful \u0026 super tiny (![bundlephobia package size](https://badgen.net/bundlephobia/minzip/use-cron-parser@1.0.3) less than 5KB ✔️) (❤️obvious dep on React \u0026 single function from `date-fns`) hook to parse cron expression and get Date object with next cron occurrence.\n\n## Installation\n\n```sh\nnpm i use-cron-parser --save\n```\n\nAlternatively you may use `yarn`:\n\n```sh\nyarn add use-cron-parser\n```\n\nLink to npm:\n[https://www.npmjs.com/package/use-cron-parser](https://www.npmjs.com/package/use-cron-parser)\n\n## Usage\n\n\n  ```javascript\n  import React from 'react';\n  import { useCronParser }  from 'use-cron-parser';\n\n  const App = () =\u003e {\n    const cronExpression = \"10 * * * *\";\n    const cron = useCronParser(cronExpression);\n    \n    return (\n      \u003cdiv className=\"App\"\u003e\n        \u003cdiv\u003e{cronExpression}\u003c/div\u003e\n        \u003cdiv\u003e{cron.next()}\u003c/div\u003e\n      \u003c/div\u003e\n    );\n  }\n\n  export default App;\n  ```\n\n[DEMO](https://use-cron-parser.netlify.app/)\n\n## Hook params\n\n | Parameter | Type                   | Description                                             | Required |\n|-----------|------------------------|---------------------------------------------------------|----------|\n| cronExpression       | string                 | Cron expression to parse                           | Y        |\n| options   | useCronParserOptions | Set of hook options (skipValidation etc.) | N        |\n\n## Options\n\n| Option       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Default   |\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|\n| skipValidation        | Flag to skip/or not validation.                                                                                                                                                                                                                                                                                                                                                                                                                  | false      |\n\nDependencies ![Deps](https://badgen.net//bundlephobia/dependency-count/use-cron-parser)\n--------\nSingle function from `date-fns` package \u0026 ❤️obvious peer dep on React only.\n\nReliability\n--------\nThis package is fully tested with total coverage set to [![Coverage Status](https://coveralls.io/repos/github/bartlomiejzuber/use-cron-parser/badge.svg)](https://coveralls.io/github/bartlomiejzuber/use-cron-parser). If you found any issue please report it [here](https://github.com/bartlomiejzuber/use-cron-parser/issues/new).\n\nLicense\n--------\n\nMade with :sparkling_heart: by [Bartlomiej Zuber (bartlomiej.zuber@outlook.com)](mailto:bartlomiej.zuber@outlook.com) and licensed under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartlomiejzuber%2Fuse-cron-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartlomiejzuber%2Fuse-cron-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartlomiejzuber%2Fuse-cron-parser/lists"}