Gathering detailed insights and metrics for codic-redis
Gathering detailed insights and metrics for codic-redis
Gathering detailed insights and metrics for codic-redis
Gathering detailed insights and metrics for codic-redis
A redis database driver for Codic task schedular. Use codic-redis as the driver for scheduling jobs with Codic.
npm install codic-redis
Typescript
Module System
Node Version
NPM Version
TypeScript (91.13%)
JavaScript (8.87%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
5 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Nov 08, 2021
Latest Version
2.0.0
Package Id
codic-redis@2.0.0
Unpacked Size
134.80 kB
Size
36.06 kB
File Count
89
NPM Version
5.6.0
Node Version
10.1.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
New to Codic? Codic allows you to create javascript jobs for any database you are using. No need to install a separate database for managing automated jobs. Read more here.
Codic uses Activities and Tasks to let you automate processes in your app.
A task is what you want to do at a particular time. It can be a simple function or a file exporting a function.
Activity specifies the time and how often one or more tasks are run. It can run one or more tasks, it can be updated at runtime.
You can store the tasks and activities using any database through its drivers interface. codic-redis is a driver implementation for redis database.
Install codic and codic-redis.
npm install --save codic codic-redis
or
yarn add codic codic-redis
codic-redis is now version 2, with typescript support just like codic. Note: your app does not have to be in typescript to use the library.
In your code, do the following:
1import Codic from "codic"; 2import RedisDriver from "codic-redis"; 3 4//instatiate redis driver and codic 5var driver = new RedisDriver(); 6var codic = new Codic(driver); 7 8// define your tasks 9const simpleLogTask = (activity) => { 10 console.log("Simply saying "+activity.attrs.data.message); 11} 12// use an IIFE, to create database activities 13(async function(){ 14 15 try { 16 // register task on Codic 17 await codic.assign("log something",{},simpleLogTask); 18 19 //create the activities that run the tasks 20 await codic 21 .run("log something") 22 .every(3) //3 seconds 23 .use({ message: "Hello" }) //pass data to task 24 .save(); 25 26 //start codic 27 await codic.start(); 28 } catch (error) { 29 console.log(error); 30 } 31})();
Thats it. You are live!!
Remember to start your redis server for this to work.
codic-redis uses ioredis under the hood. You would configure it the same way you configure ioredis. ioredis is a robust, performance-focused and full-featured Redis client for Node.js.
On instantiation, pass your configuration object to the RedisDriver like below:
1 2var driver = new RedisDriver({ 3 port: 6379, // Redis port 4 host: '127.0.0.1', // Redis host 5 family: 4, // 4 (IPv4) or 6 (IPv6) 6 password: 'auth', 7 db: 0 8}); 9
Once this is running, you have access to the underlying ioredis
object via
driver.db
All of ioredis actions can be performed on the driver.db
object. You can follow the ioredis documentation here.
Redis requires a server to be running on your host computer. It is recommended that you use redis version >4.0.0
.
Linux users can download it from their package manager though that might be out of date.
Make sure your redis server is running on the same port as you specify in the redis configuration above.
Click here for Codic documentation.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More