# cron-module-actions

> cron helper that imports a given folder

Latest version **0.2.4** (published 2023-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install cron-module-actions
pnpm add cron-module-actions
yarn add cron-module-actions
bun add cron-module-actions
```

Provides the command `cma`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-02-16 |
| First published | 2022-06-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 3 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | moshmage@gmail.com |
| Maintainers | moshmage |
| Keywords | cron, js, module, cli |

## Links

- npm: https://www.npmjs.com/package/cron-module-actions
- Repository: https://github.com/moshmage/cron-module-actions
- Homepage: https://github.com/moshmage/cron-module-actions#readme
- Issues: https://github.com/moshmage/cron-module-actions/issues
- npm.io page: https://npm.io/package/cron-module-actions

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [node-cron](https://npm.io/package/node-cron.md) ^3.0.1
- [cron-parser](https://npm.io/package/cron-parser.md) ^4.4.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.4 (latest) — 2023-02-16
- 0.2.3 — 2023-02-16
- 0.2.2 — 2023-02-16
- 0.2.1 — 2023-02-16
- 0.2.0 — 2023-02-16
- 0.1.7 — 2023-02-16
- 0.1.6 — 2022-09-12
- 0.1.5 — 2022-09-10
- 0.1.4 — 2022-09-09
- 0.1.3 — 2022-06-08
- 0.1.2 — 2022-06-08
- 0.1.1 — 2022-06-07
- 0.1.0 — 2022-06-07
- 0.0.4 — 2022-06-06
- 0.0.3 — 2022-06-06
- … 1 more at https://npm.io/package/cron-module-actions/versions

## README

# Cron Module Actions
A cron helper that imports a given folder

```shell
$ npm install -g cron-module-actions
```

## Usage

### Create a simple module
Modules are javascript files that export `name`, `description`, `schedule`, `author` and `action` properties.
All should be strings, except `action` that should be a `void` function.

`schedule` prop **must** be a valid cron time format.

```js
export const name = "Name";
export const description = "Description";
export const schedule = "1 * * * * *";
export const author = "moshmage@gmail.com"

export function action() {
  console.log(`Hello!`, new Date());
}
```

### Point the cli to the folder
```shell
$ cma ./path/to/folder/with/modules
```

### Alternatively you can import the cma by hand on your code
```javascript

cronModuleActions(
  /* only .js modules will be imported */
  await getModules(`file/to/modules`),

  /* muted, if false will console.log information */
  true
)

```

---
_Source: https://npm.io/package/cron-module-actions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
