{"id":16584487,"url":"https://github.com/brettlangdon/continuous","last_synced_at":"2025-04-14T10:13:14.012Z","repository":{"id":3900400,"uuid":"4988553","full_name":"brettlangdon/Continuous","owner":"brettlangdon","description":"Event based interface to setTimeout and setInterval.","archived":false,"fork":false,"pushed_at":"2012-08-23T13:00:08.000Z","size":108,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T10:13:08.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brettlangdon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-11T12:18:23.000Z","updated_at":"2014-10-26T19:18:28.000Z","dependencies_parsed_at":"2022-07-31T14:19:21.755Z","dependency_job_id":null,"html_url":"https://github.com/brettlangdon/Continuous","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettlangdon%2FContinuous","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettlangdon%2FContinuous/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettlangdon%2FContinuous/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettlangdon%2FContinuous/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brettlangdon","download_url":"https://codeload.github.com/brettlangdon/Continuous/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860168,"owners_count":21173342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T22:44:46.463Z","updated_at":"2025-04-14T10:13:13.984Z","avatar_url":"https://github.com/brettlangdon.png","language":"JavaScript","readme":"[![build status](https://secure.travis-ci.org/brettlangdon/Continuous.png)](http://travis-ci.org/brettlangdon/Continuous)\n#Continuous\n\n##About\nContinuous is an event based utility used for setTimeout and setInterval.\nIt is useful when trying to have code that runs at random or continuous intervals.\n\n\n##How to Install:\n```\nnpm install continuous\n``` \n\n##How to Use:\n\n```\nvar continuous = require('continuous');\n    \n//tell it to run 5 times\n//every 1 to 3 seconds\nvar options = {\n    limit: 5,\n    minTime: 1000,\n    maxTime: 3000,\n    callback: function(){\n        console.log('I have run');\n        return Math.round(new Date().getTime()/1000.0);\n    },\n    random: true\n};\n    \nvar run = new continuous( options );\n\nrun.on('started', function(){\n    console.log('It has begun to run');\n});\n    \nrun.on('stopped', function(){\n    console.log('All Done');\n});\n    \nrun.on('complete', function(count, result){\n    console.log('I have run ' + count + ' times');\n    console.log('The return of callback is:');\n    console.dir(result);\n});\n    \n//start it\nrun.start();\n    \n//force it to stop after 5 seconds\nsetTimeout( function(){\n    run.stop();\n}, 5000 );\n```\n\n##Options:\n \n* `limit`: Number - optional, default: -1(forever)\n* `time`: Number - milliseconds between runs (non-random only), default: 1000\n* `minTime`: Number - min allowed milliseconds between runs (random only), default: 0\n* `maxTime`: Number - max allowed milliseconds between runs (random only), default: 1000\n* `random`: Boolean - whether or not it should run randomly between minTime and maxTime, default: false\n* `callback`: Function - function to run continuously\n    \n##Methods:\n\n* `start()` - start running\n* `stop()` - stop running\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettlangdon%2Fcontinuous","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrettlangdon%2Fcontinuous","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettlangdon%2Fcontinuous/lists"}