{"id":20743059,"url":"https://github.com/aimingoo/continuer","last_synced_at":"2026-03-06T02:48:02.624Z","repository":{"id":25275272,"uuid":"28700877","full_name":"aimingoo/continuer","owner":"aimingoo","description":"continue sequence of functions, is very lightweight and powerful function queue for javascript (NodeJS and ...)","archived":false,"fork":false,"pushed_at":"2015-01-04T16:48:03.000Z","size":403,"stargazers_count":37,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-02T03:24:14.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimingoo.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":"2015-01-02T02:03:22.000Z","updated_at":"2023-11-03T17:11:24.000Z","dependencies_parsed_at":"2022-09-08T14:20:54.490Z","dependency_job_id":null,"html_url":"https://github.com/aimingoo/continuer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aimingoo/continuer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Fcontinuer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Fcontinuer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Fcontinuer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Fcontinuer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimingoo","download_url":"https://codeload.github.com/aimingoo/continuer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimingoo%2Fcontinuer/sbom","scorecard":{"id":173103,"data":{"date":"2025-08-11","repo":{"name":"github.com/aimingoo/continuer","commit":"5e594821070be60a012f9b00aa69a519b579b4da"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T17:05:12.297Z","repository_id":25275272,"created_at":"2025-08-16T17:05:12.297Z","updated_at":"2025-08-16T17:05:12.297Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30159969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-17T07:08:55.399Z","updated_at":"2026-03-06T02:48:02.584Z","avatar_url":"https://github.com/aimingoo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"continuer [![npm version](https://badge.fury.io/js/continuer.svg)](https://www.npmjs.com/package/continuer)\n=========\n\ncontinue sequence of functions.\n\n## Installation\ndownload continuer.js as a file module. or install continuer package by npm:\n\n```bash\n$ npm install continuer\n```\n\n## Usage\nfor sample, you need a http client sequence:\n\n  1. get http://www.google.com/\n  2. get http://www.yahoo.com/\n  3. get http://www.facebook.com/\n\nby default, use a global singleton continuer:\n\n```javascript\n// npm install request\nvar httpcli = require('request');\nvar getter = httpcli.get.bind(httpcli);\nvar callback = function(err, response, body) {\n  console.log(\"Got response: \" + response.statusCode, \"Length: \" + body.length);\n}\n\nrequire('continuer')\n  .next(getter, ['http://www.google.com/', callback])\n  .next(getter, ['http://www.yahoo.com/', callback])\n  .next(getter, ['http://www.facebook.com/', callback])\n  .do();\n```\n\nor new a continuer instance:\n\n```javascript\n...\nrequire('continuer')()\n  .next(getter, [...])\n  .next(...)\n  // more and more...\n  .do();\n```\n\n## Interace and paraments\n\n```javascript\n// get global singleton\nvar c = require('continuer')\n// a new instance\nvar c = require('continuer')()\n\n/** next() \n *  - func: a function, put into continue sequence\n *  - args: arguments for \u003cfunc\u003e, Optional\n *     - instane of Array/Arguments: func's arguments\n *     - false value(undefined/null/0/...): arguments is lazyed, or none\n *  - continuator: a object with .do() method, Optional.\n**/\nc.next(func, args, continuator)\n\n/** isCallback() \n *  - func: a function, will callback by host\n *  - args: see also c.next(), Optional\n *  - continuator: see also c.next(), Optional\n *    - true value: force skip callback-warp when last_arg isnt callback function of \u003cargs\u003e\n**/\nc.isCallback(func, args, continuator)\n\n/** do() \n * execute continue sequence now\n**/\nc.do()\n```\n\n## Exception or Error report\n\nif got exception/error, will break the sequence and report with un-executed items of queue. output example:\n\n```javascript\n[Error: error at here, break now]\n[Queue]: \n [ [ [Function] ],\n   [ [Function], [ [Function], 1000 ] ],\n   [ [Function] ] ]\n```\n\n## Advanced: isCallback()\n\nfor randomized calls:\n\n```javascript\nvar i, funcs = []\nfor (i=0; i\u003c10; i++) {\n  funcs[i] = [new Function(\"console.log(\" + i + \")\"), Math.floor(Math.random()*2000)]\n}\n```\n\nasynchronous call these:\n\n```javascript\nfuncs.forEach(function(item){\n  setTimeout(item[0], item[1])\n})\n```\n\ngot output(or anythings):\n\n```\n1\n8\n4\n2\n9\n5\n3\n6\n0\n7\n```\n\nuse continuer to got Synchronous calls:\n\n```javascript\nvar c = require('continuer')();\nfuncs.forEach(function(item) {\n  c.next(setTimeout, [c.isCallback(item[0]), item[1]])\n})\nc.do()\n```\n\nnow, got output:\n\n```\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n```\n\n\n## Advanced: with no-callback functions\n\nuse continuer instance as a Continuator, you can continue anythings.\n\n```\nfunction cb() {\n  console.log('ding...')\n}\n\nfunction normal() {\n  console.log('dong...')\n}\n\nvar c = require('continuer')();\n\nc.next(setTimeout, [c.isCallback(cb), 2000])   // 2s\n .next(normal, [], c)                          // immediately, c as Continuator\n .next(setTimeout, [c.isCallback(cb), 1000])   // 1s\n .next(normal, [], c)                          // immediately, c as Continuator\n .do();\n```\n\noutput:\n\n```\nding...\ndong...\nding...\ndong...\n```\n\nbut, what's Continuator?\n\nIt's simple, very simple. a Continuator is a object with a 'do' function member, ex:\n\n```\naContinuator = {\n  'do': function() { ... }\n}\n```\n\nso, A continuer instance is Array/Queue type, Continuer type, and Continuator type.\n\nand, global singleton continuer is Function type.\n\n\n## Advanced: powerful continuator, pass/lazyed arguments\n\nfor this case, how to say hello?\n\n```\nfunction a() {\n  return 'hello'\n}\n\nfunction b(msg) {\n  console.log('say: ' + msg)\n}\n```\n\nOk, for sequential programming:\n\n```\nb(a())\n```\n\nbut, Asynchronous?\n\n```\nsetTimeout(function() {\n  result = a();\n  setTimeout(function() {\n    b(result)\n  }, 1000)\n}, 1000)\n\n```\n\nGod!\n\nnow, use a continuator:\n\n```\n// put arguments at top of continued queue, the next(b) is normal function\n//  - if args is lazyed, pass false/null/undefined/0/\"\" on next()\nvar c = require('continuer')();\nvar continuedArgs = function(continuer) {\n  return {\n    'do': function() { continuer.do(continuer[0][1] = arguments) }\n  }\n}(c)\n\nc.next(a, [], continuedArgs)\n .next(b) // \u003c-- lazyed\n .do()\n\n// or\n\nc.next(setTimeout, [c.isCallback(a, [], continuedArgs), 1000])\n .next(b) // \u003c-- lazyed\n .do()\n```\n\nor\n\n```\n// put custom/lazyed arguments for next setTimeout()\nvar c = require('continuer')();\nvar continuedArgs2 = function(continuer) {\n  return {\n    'do': function() { continuer.do(continuer[0][1] = [continuer.isCallback(b, arguments), 1000]) }\n  }\n}(c)\n\n// if args is lazyed, pass false/null/undefined/0/\"\" on next()\nc.next(setTimeout, [c.isCallback(a, [], continuedArgs2), 1000])\n .next(setTimeout)  // \u003c-- lazyed\n .next(function() {\n        console.log('continue...')\n  })\n .do()\n ```\n\n## Advanced: powerful continuator, use continuer as callback\n\nmethod continuer.do() is continuer binded, so you can use it as normal callback function. ex:\n\n```\nfunction ding() {\n  console.log('ding...')\n}\n\nfunction dong() {\n  console.log('dong...')\n}\n\nc = require('continuer')();\nc.next(ding, [], c)\n .next(dong, [], c)\n .next(ding, [], c)\n .next(dong, [], c);\n\nsetTimeout(c.do, 2000);\n```\n\nso, you can do more:\n\n```\nfunction step1(resp) {\n  resp.on('data', function() { ... })\n  return 'ok, step1 completed.'\n}\n\nfunction step2(msg) {\n  console.log(msg)\n  resp.on('end', function() { ... })\n}\n\nvar options = {url: 'http://www.google.com/'}\nvar c = require('continuer')()\nvar continuedArgs = function(continuer) {\n  return {\n    'do': function() { continuer.do(continuer[0][1] = arguments) }\n  }\n}(c)\n\n// 1. build a continued sequence, but dont do() it\n//   - on next(), if args is lazyed, pass false/null/undefined/0/\"\"\nc.next(step1, false, continuedArgs)    // 4. pass step1 result as arguments of step2\n .next(step2, false, c);               // 5. next, or no more\n\n// 2. continuedArgs.do will bind arguments(response and more) at top of continued queue, and\n// 3. call c.do\nrequire('http').request(options, continuedArgs.do)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimingoo%2Fcontinuer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimingoo%2Fcontinuer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimingoo%2Fcontinuer/lists"}