Skip to content

yojona/every

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Every.js

Call function every second

const {call} = require('every')

function sayHello() {
    console.log('Hi')
}

call(sayHello).every(1000)

Call function immediately and every second

const {call} = require('every')

function sayHello() {
    console.log('Hi')
}

call(sayHello).now().and().every(1000)

Call function, wait 1 second and run it again

const {sleep} = require('every')

async function main() {
    sayHello()
    await sleep(1000)
    sayHello()
}

main()

About

Small library to handle recurring calls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published