Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
joseananio committed Jan 7, 2019
1 parent 81a0e9d commit 0f3ceb0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Kudos for making the comparison chart goes to [Bull](https://www.npmjs.com/packa
The inspiration comes from [Agenda](https://github.com/agenda/agenda)


## Content

[Installation](#installation)
[Usage](#usage)
Expand All @@ -100,7 +101,6 @@ The inspiration comes from [Agenda](https://github.com/agenda/agenda)
[Creating Drivers](#creating-drivers)

## Installation
---

```
npm install --save codic
Expand All @@ -112,6 +112,7 @@ yarn add codic


## Usage

Codic is easy to implement. In your code, do the following:
```javascript
import Codic from "codic";
Expand Down Expand Up @@ -172,9 +173,9 @@ var codic = new Codic(driver);

// ... continue as above
```

<br/>
## Concept
----

[Codic](https://github.com/joseananio/codic.git) uses Activities and Tasks to let you automate processes in your app.

### Tasks
Expand All @@ -189,7 +190,7 @@ So when a scheduled activity is executed, it will run one or more tasks before i
<br>

## More examples
---

Assuming we have defined a task as follows:
```javascript
import mailer from "somepackage";
Expand Down Expand Up @@ -243,8 +244,9 @@ await codic.run(
.save();

```

<br/>
## Dynamic tasks

Dynamic tasks can be created and executed at any point in your execution cycle. You will then be able to pass different data to the task at any point in your code.

To use dynamic tasks, define each task in a separate file and export it as default:
Expand Down Expand Up @@ -287,7 +289,7 @@ You can also create several activities that use the same task, during runtime.
<br>
<br>

## Updating activities
### Updating activities
To update an activity, set a name for it during creation. You can then use the name to fetch, modify and then save the change.
```javascript
await codic.run("send emails")
Expand All @@ -310,7 +312,6 @@ await annualMA.save();
<br/>

## Codic v2 Typescript
---

We have written codic to make it easy for anyone to use and build upon. Fully **Typescript**, in-built **memory driver**, and even more tests with **mocha**

Expand All @@ -324,8 +325,9 @@ We have included declarations for all methods and variables. More comments will
Right on the start, you get a default memory driver. That means codic can work standalone if you do not supply external driver. Memory driver means your schedules won't survive a service restart.
For production use, do opt for an external persistent storage driver.

<br/>
## Creating drivers
---

Creating a codic storage driver is easy. Just implement the methods and properties on the driver interface and you are done.

### Driver structure
Expand Down

0 comments on commit 0f3ceb0

Please sign in to comment.