0.1.0 • Published 1 year ago

cybernate v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

How to use and Automate functions over time

import cyberNate from 'cybernate';

// Example usage:
const firstFunction = () => {
  console.log('Function executed!');
};

const secondFunction = () => {
  console.log('Function executed!');
};

cyberNate(firstFunction, 2000);
cyberNate(secondFunction, 20000);

Execute at certain time

import atTime from './atTime';

// Example usage:
const myFunction = () => {
  console.log('Function executed at target time!');
};

// Call myFunction at 3:30 AM tomorrow
const targetTime = new Date();
targetTime.setDate(targetTime.getDate() + 1); // Tomorrow
targetTime.setHours(3); // 3:00 AM
targetTime.setMinutes(30); // 3:30 AM

atTime(myFunction, targetTime);
0.1.0

1 year ago