{"id":21466975,"url":"https://github.com/thiagodnf/check-arguments","last_synced_at":"2025-07-06T15:03:20.221Z","repository":{"id":44172454,"uuid":"502763237","full_name":"thiagodnf/check-arguments","owner":"thiagodnf","description":"A little javascript library for checking argument values","archived":false,"fork":false,"pushed_at":"2022-07-08T20:07:48.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T15:36:19.410Z","etag":null,"topics":["arguments","checking","parameters","type-check","validate"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/check-arguments","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/thiagodnf.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":"2022-06-13T00:53:08.000Z","updated_at":"2022-07-08T17:33:36.000Z","dependencies_parsed_at":"2022-09-05T17:20:33.557Z","dependency_job_id":null,"html_url":"https://github.com/thiagodnf/check-arguments","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fcheck-arguments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fcheck-arguments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fcheck-arguments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagodnf%2Fcheck-arguments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagodnf","download_url":"https://codeload.github.com/thiagodnf/check-arguments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982182,"owners_count":20378605,"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":["arguments","checking","parameters","type-check","validate"],"created_at":"2024-11-23T08:16:15.974Z","updated_at":"2025-03-17T06:10:52.590Z","avatar_url":"https://github.com/thiagodnf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"https://user-images.githubusercontent.com/98138701/173466440-2a051a17-b509-4ca6-9499-87bc3b2d0944.png\" width=\"300px\"/\u003e\n\nA little javascript library for checking argument values\n\n[![Build](https://github.com/thiagodnf/check-arguments/actions/workflows/build.yml/badge.svg)](https://github.com/thiagodnf/check-arguments/actions/workflows/build.yml)\n[![GitHub Release](https://img.shields.io/github/release/thiagodnf/check-arguments.svg)](https://github.com/thiagodnf/check-arguments/releases/latest)\n[![GitHub contributors](https://img.shields.io/github/contributors/thiagodnf/check-arguments.svg)](https://github.com/thiagodnf/check-arguments/graphs/contributors)\n[![GitHub stars](https://img.shields.io/github/stars/thiagodnf/check-arguments.svg)](https://github.com/thiagodnf/check-arguments)\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n## Why\n\nIt takes time to add explicit conditions to your functions to check arguments and throw errors. The purpose of this library is to assist developers on writing efficiently and reliably those conditions.\n\n## How Do I Install It?\n\nVia NPM:\n\n```sh\nnpm i check-arguments --save\n```\n\n## How to I Use It?\n\nLoading the library:\n\n```js\nconst { check } = require(\"check-arguments\");\n```\n\nNow you can use it on your functions:\n\n```js\nfunction foo(val){\n\n    check(val).isString().isNotBlank();\n\n    // The remaining source code\n}\n```\n\nor\n```js\nfunction foo(a, b){\n\n    check(a).isInt().isBetween(12, 20);\n    check(b).isString();\n\n    // The remaining source code\n}\n```\n\n### Predicates\n\nThese are the list of predicates you may use\n\nFor `isNumber()`:\n\n - `isLessThan(max)`\n - `isLessThanOrEqualsTo(max)`\n - `isGreaterThan(min)`\n - `isGreaterThanOrEqualsTo(min)`\n - `isBetween(min, max)`\n - `inRange(min, max)`\n - `isPositive()`\n - `isNegative()`\n\nFor `isInt()`:\n\n - `isEven()`\n - `isOdd()`\n\nFor `isString()`:\n\n - `isNotBlank()`\n\nFor `isObject()`:\n\n - `hasKey()`\n - `isEmpty()`\n\n## For Developers\n\nInstall the dependencies\n\n```bash\nnpm install\n```\n\nRun the development enviroment\n\n```bash\nnpm run dev\n```\n\n## Questions or Suggestions\n\nFeel free to access the \u003ca href=\"../../discussions\"\u003ediscussions tab\u003c/a\u003e as you need\n\n## Contribute\n\nContributions to the this project are very welcome! We can't do this alone! Feel free to fork this project, work on it and then make a pull request.\n\n## License\n\nLicensed under the [MIT license](LICENSE).\n\n## Donate\n\nI open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).\n\nHowever, if you get some profit from this or just want to encourage me to continue creating stuff, reach out to me if you want to do it.\n\nThanks!\n\n❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodnf%2Fcheck-arguments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagodnf%2Fcheck-arguments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagodnf%2Fcheck-arguments/lists"}