{"id":16942176,"url":"https://github.com/samouri/arity","last_synced_at":"2026-04-22T05:32:26.116Z","repository":{"id":71231652,"uuid":"112262948","full_name":"samouri/arity","owner":"samouri","description":"a tiny library for reliably determining arity","archived":false,"fork":false,"pushed_at":"2017-11-28T21:19:51.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T04:37:41.796Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samouri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-28T00:01:52.000Z","updated_at":"2019-11-27T05:41:04.000Z","dependencies_parsed_at":"2023-02-25T13:00:55.501Z","dependency_job_id":null,"html_url":"https://github.com/samouri/arity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samouri/arity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Farity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Farity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Farity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Farity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samouri","download_url":"https://codeload.github.com/samouri/arity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samouri%2Farity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32122715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"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-10-13T21:11:15.649Z","updated_at":"2026-04-22T05:32:26.096Z","avatar_url":"https://github.com/samouri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"arity \n=====\n[![CircleCI](https://circleci.com/gh/samouri/arity.svg?style=svg)](https://circleci.com/gh/samouri/arity)\n\n\u003e In logic, mathematics, and computer science, the arity /ˈærɪti/ of a function is the number of arguments or operands that the function takes.\n\nSometimes you want to be able to tell how many arguments a function takes.\n99% of the time you can do something as simple as calling `fn.length` -- but this will not work if a function accesses the [arguments](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) object directly.\nThis module will even return the correct number of arguments to expect for those tricky cases.\n\n\n\n### Install\n\n```bash\nnpm install --save-dev arity\n```\n\n### To use\n```javascript\nconst arity = require('arity');\n\nfunction doSomething(arg1, arg2) { ... }\n\nconst arityOfDoSomething = arity(doSomething); // value will be 2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamouri%2Farity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamouri%2Farity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamouri%2Farity/lists"}