{"id":17041921,"url":"https://github.com/cloudhead/vargs","last_synced_at":"2025-04-12T14:40:31.446Z","repository":{"id":66106839,"uuid":"601335","full_name":"cloudhead/vargs","owner":"cloudhead","description":"practical variable argument handling in node.js","archived":false,"fork":false,"pushed_at":"2015-11-05T01:10:28.000Z","size":123,"stargazers_count":22,"open_issues_count":3,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T09:11:30.792Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudhead.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":"2010-04-08T19:42:05.000Z","updated_at":"2022-12-09T01:49:05.000Z","dependencies_parsed_at":"2023-02-19T22:45:37.096Z","dependency_job_id":null,"html_url":"https://github.com/cloudhead/vargs","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/cloudhead%2Fvargs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fvargs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fvargs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fvargs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudhead","download_url":"https://codeload.github.com/cloudhead/vargs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248582316,"owners_count":21128355,"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-14T09:14:11.828Z","updated_at":"2025-04-12T14:40:31.425Z","avatar_url":"https://github.com/cloudhead.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nvargs\n=====\n\n\u003e variable argument handling for functions taking a callback\n\nrationale\n----------\n\nJavaScript has very poor argument handling. *vargs* tries to make it simpler.\n\nsynopsis\n--------\n\n    var Args = require(\"vargs\").Constructor;\n  \n    function (/* [arg1, arg2, ...][,callback] */) {\n        var args = new(Args)(arguments);\n        \n        args.first;    // first argument\n        args.last;     // last argument before callback\n        args.callback; // callback argument, or an empty function\n        args.all;      // all arguments except callback\n        args.length;   // number of arguments, not including callback\n        \n        args.callbackGiven(); // returns true or false\n        args.at(-1);          // last argument, including callback\n        args.array;           // all arguments, including callback\n    }\n\nexample\n-------\n\nFor a real-world example of *vargs*, check \u003chttp://github.com/cloudhead/cradle\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudhead%2Fvargs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudhead%2Fvargs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudhead%2Fvargs/lists"}