{"_id":"@cheap-glitch/mi-cron","_rev":"4-c20f10f70bb1d0ed5e43c0a897032ecb","name":"@cheap-glitch/mi-cron","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@cheap-glitch/mi-cron","version":"1.0.0","keywords":["cron","cron-expression","crontable","parser"],"author":{"url":"https://github.com/cheap-glitch","name":"cheap glitch","email":"cheap.glitch@gmail.com"},"license":"ISC","_id":"@cheap-glitch/mi-cron@1.0.0","maintainers":[{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"}],"homepage":"https://github.com/cheap-glitch/mi-cron#readme","bugs":{"url":"https://github.com/cheap-glitch/mi-cron/issues"},"dist":{"shasum":"34c9cfe5d13b5d65b18c8add93ba6daf1bd9d16d","tarball":"https://registry.npmjs.org/@cheap-glitch/mi-cron/-/mi-cron-1.0.0.tgz","fileCount":9,"integrity":"sha512-xrQuPYD+yfC6ZKRF0zjLNjePcm0KLasH8wKEiHWkfjp/epJLe03hLUY57CoK7WHzUSLeXT0ffXnZ6cbxWEs7uA==","signatures":[{"sig":"MEUCIQDzIZFcZU+ZW1ZxNpjxwrYl7t/UNK4oYnzaG4PmvKAYRgIgFhEK5Jz9p/kz8RFRaXaogueAJeAGf6/UoLWHP+MJdJI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcN/ECRA9TVsSAnZWagAAwKQQAI1s5Vx8wYpCOLNveu3v\ne3Rxl3kCIwekUH2w0cZDCv6W5ueRdTcXo/WuozBjqUxoOPrqW8OGlyCjZtIZ\nnJxFaMWsO/GvxvWM+mH3/i7zxzAEHQyE/p+9b+DRszhDJSlfG8uTlurwMOzT\nL96HSrzURVnoNdTIVlem4Y+FrEpwSqu434UO58yXnj0zINGMj438ajJcWMn0\nOQ8/OmurZFVtye21p9kAoK1rY4+Y+TUWyCqYVK8hT8lg0FepWcvbzb9uhmwA\n0Fex+pAHshkT5OQ/SOA21cF0ZPwlFyPzSt+/MQfDY2z2w0SsZTjI0VhGe2mK\nXUFyvVHZ5Kpqp/QVbfqFrwNL2eyUALnY1HG2g0fPVUGoVuFJ1OtI1M6wF7Do\niElQRdpFl7l4xdROt14ByXo7eRNT0cKFMYfr+nZCvFDM7Es90f2FIyw8Bk/s\nuviOrOp7PQX866dKTAo0EEu/HArZQfEPufsNx/jD8hNsmlhbIHERBTspLSJV\n5TAVrlRU6DEyCZMIvY8iYH8VLxZtsjSmqRfU8o/7OuRUrLkco1Ozt1ntzFbc\nTBxUbIWrE+ZMLY8VuwvLmi+TlZsm9mKz+ERD4qWZwLFcK3f91T+sGksT0lvi\nWmGSia3pxW/A9KuDznTMKXiS3GtvUimUnygyCtwLaXoMLmzAKKKh3O+Kzyny\nlD5D\r\n=iWLg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.min.js","gitHead":"bbd6239bdeeb9936b8ff0c97aa8c51144a5b39d7","scripts":{"lint":"eslint . --ext .ts","test":"npm run build:ts && mocha","build":"npm run build:ts && npm run build:minify","build:ts":"tsc","coverage":"nyc npm test","test:watch":"nodemon -e js,ts --watch . --watch test --ignore index.js --exec 'npm run test || exit 1'","build:minify":"terser --compress --mangle toplevel --comments '/^!/' --output index.min.js -- index.js","coverage:report":"npm run coverage && nyc report --reporter=text-lcov | codecov --pipe --disable=gcov"},"_npmUser":{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"},"repository":{"url":"git+https://github.com/cheap-glitch/mi-cron.git","type":"git"},"_npmVersion":"6.14.8","description":"A microscopic parser for standard cron expressions.","directories":{"test":"test"},"_nodeVersion":"14.12.0","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","chai":"^4.2.0","mocha":"^8.1.3","eslint":"^7.10.0","terser":"^5.3.2","nodemon":"^2.0.4","typescript":"^4.0.3","@typescript-eslint/parser":"^4.2.0","@typescript-eslint/eslint-plugin":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/mi-cron_1.0.0_1601232835722_0.7693130739197791","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@cheap-glitch/mi-cron","version":"1.0.1","keywords":["cron","cron-expression","crontable","parser"],"author":{"url":"https://github.com/cheap-glitch","name":"cheap glitch","email":"cheap.glitch@gmail.com"},"license":"ISC","_id":"@cheap-glitch/mi-cron@1.0.1","maintainers":[{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"}],"homepage":"https://github.com/cheap-glitch/mi-cron#readme","bugs":{"url":"https://github.com/cheap-glitch/mi-cron/issues"},"dist":{"shasum":"111f4ce746c269aedf74533ac806881763a68f99","tarball":"https://registry.npmjs.org/@cheap-glitch/mi-cron/-/mi-cron-1.0.1.tgz","fileCount":9,"integrity":"sha512-kxl7vhg+SUgyHRn22qVbR9MfSm5CzdlYZDJTbGemqFFi/Jmno/hdoQIvBIPoqFY9dcPyxzOUNRRFn6x88UQMpw==","signatures":[{"sig":"MEYCIQCkgD+PEVnZ3JoF+LHDAjgtHWifc3Hj2G8o9wQPI82BRQIhAOKeOt/TH8vfg03+drongP6z/ME3e03jngjZ3bpugyhC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdGMBCRA9TVsSAnZWagAAHiYQAJKJDWX2QAAozfngDxC5\nfE9tN6Isk6xUiXVuF3InB426PR8bSl48ntkZFO3HnPXiWsZhS7uAXcWE0fg2\nNTF1n3wayiE2MMCi5CtIHTnl3pYHDHc6DSNq0hh1u8okIEuDnJb8/omY8Auv\n4quHLhSk/q1DDdK2J+O5z8oZg7pkUCQ6hAKgc6m/wrGXUFWPLYKx5b9fjcr5\nnycP1wQJf488sy6WHWQu+rs7zZc8exUnxSMe6kDKnZNEZNb6Z+mgIg1/0O4V\nirp4QrDvJWxKtVYfaE68jCAAPLTbRwqtM6q/6c/Uru8wLFrykoJbe+ME6vVZ\nGCEf9RcIMnotOOaSPqZeiZ3RVWMvAQE0bQskR09ybOn37rnFHsmklkU5CnSB\nK0WyF5g2GoicAyt4wDLjYDAacA2was+vEQQ1JlheQV1MomQMj4Z3hJPaIZa8\nVwDKUWq4Rs3CpNV+Sur75rnOlS5yPrL4UqHA+EXFu7IOKH32Prfnq80R3ifV\nxh6RYzhWN4XJXOju0RTWlh57bY9iJcalUFIkUjH+5w2/mfzGX+jK/Xc/5Sm9\nnIllBqA32sJySopEB2XV54lLrRd8t14scmOLEVi4O5205HuM2U8RC3/nckZE\n0nZyjjBDiwkT+RIjatIVfUbqyQl6zQKYeqIPLiBMVuanvqaccvNme3m0XYrh\ne6TK\r\n=5CVV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.min.js","gitHead":"68e7827024fc32c40673bef527d99a226fc25399","scripts":{"lint":"eslint . --ext .ts","test":"npm run build:ts && mocha","build":"npm run build:ts && npm run build:minify","build:ts":"tsc","coverage":"nyc npm test","test:watch":"nodemon -e js,ts --watch . --watch test --ignore index.js --exec 'npm run test || exit 1'","build:minify":"terser --compress --mangle toplevel --comments '/^!/' --output index.min.js -- index.js","coverage:report":"npm run coverage && nyc report --reporter=text-lcov | codecov --pipe --disable=gcov"},"_npmUser":{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"},"repository":{"url":"git+https://github.com/cheap-glitch/mi-cron.git","type":"git"},"_npmVersion":"6.14.8","description":"A microscopic parser for standard cron expressions.","directories":{"test":"test"},"_nodeVersion":"14.13.0","_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","chai":"^4.2.0","mocha":"^8.1.3","eslint":"^7.10.0","terser":"^5.3.2","nodemon":"^2.0.4","typescript":"^4.0.3","@typescript-eslint/parser":"^4.2.0","@typescript-eslint/eslint-plugin":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/mi-cron_1.0.1_1601463040993_0.3748127998425932","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@cheap-glitch/mi-cron","version":"2.0.0","description":"A microscopic parser for standard cron expressions.","license":"ISC","author":{"name":"cheap glitch","email":"cheap.glitch@gmail.com","url":"https://github.com/cheap-glitch"},"repository":{"type":"git","url":"git+https://github.com/cheap-glitch/mi-cron.git"},"homepage":"https://github.com/cheap-glitch/mi-cron#readme","bugs":{"url":"https://github.com/cheap-glitch/mi-cron/issues"},"type":"module","keywords":["cron","crontab","crontable","date","day","hour","hours","lightweight","micro","minutes","month","parser","schedule","scheduling","small","tiny","week","weekday"],"main":"dist/index.js","exports":"./dist/index.js","types":"dist/index.d.ts","directories":{"test":"test"},"eslintConfig":{"root":true,"extends":"@cheap-glitch/typescript","env":{"es6":true}},"jest":{"preset":"ts-jest","coverageDirectory":".coverage"},"devDependencies":{"@cheap-glitch/eslint-config-typescript":"^2.4.4","@cheap-glitch/tsconfig":"^1.0.0","@types/jest":"^29.5.14","@typescript-eslint/eslint-plugin":"^8.30.1","@typescript-eslint/parser":"^8.30.1","empty-dir-cli":"^1.0.2","eslint":"^9.24.0","eslint-plugin-smarter-tabs":"^1.2.0","jest":"^29.7.0","terser":"^5.39.0","ts-jest":"^29.3.2","ts-node":"^10.9.2","typescript":"^5.8.3"},"scripts":{"build":"tsc","build:clean":"empty-dir dist && npm run build","build:watch":"tsc --watch","coverage":"npm test -- --collectCoverage","coverage:upload":"coveralls < .coverage/lcov.info","lint":"eslint . --ext .ts --ignore-path .gitignore","test":"jest --runInBand","test:watch":"npm test -- --watch"},"_id":"@cheap-glitch/mi-cron@2.0.0","_integrity":"sha512-HtpMH36PLzs7ZMJYaMWz32+4JOKeZHgzd2ms7vX0AdZmxZCu3MlASo+PoWkQaO9vT4ust7AS3j1hG783uxbiyA==","_resolved":"C:\\Users\\flore\\AppData\\Local\\Temp\\1742354b8ed672347cd95b94265d763a\\cheap-glitch-mi-cron-2.0.0.tgz","_from":"file:cheap-glitch-mi-cron-2.0.0.tgz","_nodeVersion":"23.11.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-HtpMH36PLzs7ZMJYaMWz32+4JOKeZHgzd2ms7vX0AdZmxZCu3MlASo+PoWkQaO9vT4ust7AS3j1hG783uxbiyA==","shasum":"c89588486cef4f204fc9b31e2ce796cf3abcca2c","tarball":"https://registry.npmjs.org/@cheap-glitch/mi-cron/-/mi-cron-2.0.0.tgz","fileCount":4,"unpackedSize":11284,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA7D9Hxrqa44Tlp0euneqdkN+3BdbxY/Fk1/uJFqObtrAiEA/ca1gt21oEgNWTaG3yvzvvEaGIC99CDZ/yRHxViWGVc="}]},"_npmUser":{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"},"maintainers":[{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mi-cron_2.0.0_1744907601830_0.020985792467266284"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-27T18:53:55.689Z","modified":"2025-04-17T16:33:22.159Z","1.0.0":"2020-09-27T18:53:55.830Z","1.0.1":"2020-09-30T10:50:41.182Z","2.0.0":"2025-04-17T16:33:22.001Z"},"bugs":{"url":"https://github.com/cheap-glitch/mi-cron/issues"},"author":{"name":"cheap glitch","email":"cheap.glitch@gmail.com","url":"https://github.com/cheap-glitch"},"license":"ISC","homepage":"https://github.com/cheap-glitch/mi-cron#readme","keywords":["cron","crontab","crontable","date","day","hour","hours","lightweight","micro","minutes","month","parser","schedule","scheduling","small","tiny","week","weekday"],"repository":{"type":"git","url":"git+https://github.com/cheap-glitch/mi-cron.git"},"description":"A microscopic parser for standard cron expressions.","maintainers":[{"name":"cheap-glitch","email":"cheap.glitch@gmail.com"}],"readme":"# 📆 mi-cron\n\n[![License](https://shields.io/github/license/cheap-glitch/mi-cron)](LICENSE)\n[![Latest release](https://shields.io/github/v/release/cheap-glitch/mi-cron?sort=semver&label=latest%20release&color=green)](https://github.com/cheap-glitch/mi-cron/releases/latest)\n[![Coverage status](https://shields.io/coveralls/github/cheap-glitch/mi-cron)](https://coveralls.io/github/cheap-glitch/mi-cron)\n\n**mi-cron** is a microscopic ([~1KB minified & gzipped](https://bundlephobia.com/result?p=@cheap-glitch/mi-cron))\nparser for [standard cron expressions](https://en.wikipedia.org/wiki/Cron#CRON_expression).\n\n## Features\n\n * Supports the complete standard cron syntax\n * Supports some convenient syntax extensions: @-shorthands (`@daily`) and steps (`*/10`)\n * Can compute the next scheduled date for a given expression\n * Tiny & dependency-free\n\n## Installation\n\n```\nnpm i @cheap-glitch/mi-cron\n```\n\n## Usage\n\n```javascript\nconst { parseCron } = require('@cheap-glitch/mi-cron');\n\nconsole.log(parseCron.nextDate('*/5 6-12 3 3 *').toUTCString());\n// Wed, 03 Mar 2021 06:00:00\n```\n\n## API\n\n### parseCron(exp: string): CronSchedule\n\nParses a standard cron expression. Supports:\n * globs (`*`)\n * ranges (`0-30`, `mon-fri`)\n * steps (`*/3`, `20-31/2`, `10/5`)\n * lists (`1,15`, `0-10,20-30/2`)\n * @-shorthands (`@weekly`)\n\nDoes NOT support:\n * `L`, `W`, `#`, `?`, `H`\n * year field\n * `@reboot`\n\nReturns an object with all possible values for each field (minutes, hours, days,\nmonths and days of the week), or `undefined` if the expression is invalid (wrong\nsyntax, unsupported instruction, impossible range, etc).\n\n```javascript\nconst { parseCron } = require('@cheap-glitch/mi-cron');\n\nconsole.log(parseCron('*/5 6-10 1,15 * wed'));\n// {\n// \tminutes:  [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55],\n// \thours:    [6, 7, 8, 9, 10],\n// \tdays:     [1, 15],\n// \tmonths:   [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],\n// \tweekDays: [3],\n// }\n```\n\n### parseCron.nextDate(exp: string | CronSchedule[, from: Date = new Date.now()]): Date\n\nTakes a cron schedule  or expression and returns the next  date that matches the\nschedule, or  `undefined` if the expression  is invalid. If given  a datetime as\nthe second argument, it will start  the computation from this time (otherwise it\nwill use the current datetime at the moment it's called).\n\n```javascript\nconst { parseCron } = require('@cheap-glitch/mi-cron');\n\nconsole.log(parseCron.nextDate('* * * * *', new Date('01 Jan 2020 00:00:00 GMT')).toUTCString());\n// Wed, 01 Jan 2020 00:01:00\n\n// Get the next five scheduled dates\nconst schedule = parseCron('@weekly');\nconst nextDate = new Date();\nfor (let i=0; i<5; i++) {\n\tconsole.log(nextDate = parseCron.nextDate(schedule, nextDate));\n}\n```\n\n## Changelog\n\nSee the full changelog [here](https://github.com/cheap-glitch/devlint/releases).\n\n## Contributing\n\nContributions are welcomed! Please open an issue before submitting substantial changes.\n\n## Related\n\n * [crontab.guru](https://crontab.guru) – Interactive cron schedule editor\n * [Description of the crontab format](https://crontab.guru/crontab.5.html)\n * [Best practices for cron](https://www.endpoint.com/blog/2008/12/08/best-practices-for-cron)\n\n## License\n\nISC\n","readmeFilename":"README.md"}