{"id":22672652,"url":"https://github.com/jimlynchcodes/dotcron","last_synced_at":"2026-01-07T17:14:29.725Z","repository":{"id":74887689,"uuid":"255753313","full_name":"JimLynchCodes/dotcron","owner":"JimLynchCodes","description":"Runs scripts in package.json on a schedule defined by a .cron file on windows, mac, and linux.","archived":false,"fork":false,"pushed_at":"2020-04-15T00:11:30.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T12:01:17.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/JimLynchCodes.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":"2020-04-14T23:38:13.000Z","updated_at":"2020-04-16T15:11:40.000Z","dependencies_parsed_at":"2023-02-26T21:15:45.169Z","dependency_job_id":null,"html_url":"https://github.com/JimLynchCodes/dotcron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Fdotcron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Fdotcron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Fdotcron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Fdotcron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimLynchCodes","download_url":"https://codeload.github.com/JimLynchCodes/dotcron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246176786,"owners_count":20735848,"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-12-09T16:20:08.041Z","updated_at":"2026-01-07T17:14:29.696Z","avatar_url":"https://github.com/JimLynchCodes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotcron\nRuns scripts in `package.json` on a schedule defined by a `.cron` file.\n\n\n# dotcron\n\n\u003cimg src=\"https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.png\" alt=\"dotenv\" align=\"right\" /\u003e\n\nDotcron is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](http://12factor.net/config) methodology.\n\n[![BuildStatus](https://img.shields.io/travis/motdotla/dotenv/master.svg?style=flat-square)](https://travis-ci.org/motdotla/dotenv)\n[![Build status](https://ci.appveyor.com/api/projects/status/github/motdotla/dotenv?svg=true)](https://ci.appveyor.com/project/motdotla/dotenv/branch/master)\n[![NPM version](https://img.shields.io/npm/v/dotenv.svg?style=flat-square)](https://www.npmjs.com/package/dotenv)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![Coverage Status](https://img.shields.io/coveralls/motdotla/dotenv/master.svg?style=flat-square)](https://coveralls.io/github/motdotla/dotenv?branch=coverall-intergration)\n[![LICENSE](https://img.shields.io/github/license/motdotla/dotenv.svg)](LICENSE)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\n## Install\n\n```bash\n# with npm\nnpm install dotcron\n\n# or with Yarn\nyarn add dotcron\n```\n\n## Usage\n\nCreate a file named `.cron` alongside `package.json` in the root directory of the project. Inside of the file put only one line containing a number or special character for each of the six cron fields.\n\neg:\n\n.cron\n```\n10 0/5 * * ? *\n```\n\n\n## Create a Cron Script\n\nIn the `package.json` file create a new script named `cron`:\n```\n \"scripts\": {\n    \"start\": \"node index.js\",\n    \"test\": \"jest\",\n    \"cron\": \"npm start\"\n  },\n```\n\n\n## Start the Cron Job\n\nThis runs the command for \"cron\" on the specified schedule.\n```\nnpm run cron\n```\n\n## Stop the Cron Job\n\nStop a cron job by adding the `--stop` or `-S` flag.\n```\nnpm run cron --stop\n```\n\n## List Scheduled Cron Jobs\n\nList scheduled cron jobs instead of scheduling one by adding the `--list` or `-L` flag.\n```\nnpm run cron --list\n```\n\n\n## Named Cron Configurations\nIf you want to schedule a given project with multiple different cron expressions, you can use named configurations.\n\nInstead of creating a `.cron` file, add a dot and the name to the file name: `.cron.\u003cname\u003e`. Put one cron expression in each file.\n\neg: \n\n.cron.foo\n```\n10 0/5 * * ? *\n```\n\n.cron.foo\n```\n5 10/1 * * ? *\n```\n\nThen in `package.json` scripts section add one command for each cron file with a colon between `cron` and the name.\n\neg:\n```\n \"scripts\": {\n    \"start\": \"node index.js\",\n    \"test\": \"jest\",\n    \"cron:foo\": \"npm start\",\n    \"cron:bar\": \"npm start\"\n  },\n```\n\n\n### Cron Expression Allowed Fields\n\n| Name          | Required      | Allowed Values  | Allowed Special Characters | \n| :-----------: |:-------------:| :--------------:| :------------------------: |\n| Seconds       | Y             |      0-59       |         , - * /            |\n| Minutes       | Y             |      0-59       |         , - * /            |\n| Hours         | Y             |      0-59       |         , - * /            |\n| Day of Month  | Y             |      0-59       |         , - * /            |\n| Day of Week   | Y             |      0-59       |         , - * /            |\n| Year          | Y             |      0-59       |         , - * /            |\n\n\n\n## FAQ\n\n### Do I need to add any JavaScript code to my project for this?\n\nNo. 🙂\n\n\n## Contributing Guide\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Change Log\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimlynchcodes%2Fdotcron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimlynchcodes%2Fdotcron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimlynchcodes%2Fdotcron/lists"}