{"id":15471133,"url":"https://github.com/gpestana/nosix","last_synced_at":"2025-03-28T19:29:25.496Z","repository":{"id":71290248,"uuid":"87925662","full_name":"gpestana/nosix","owner":"gpestana","description":"nosix.js abstracts input validation, making it easier and straighforward for you to validate any type of input.","archived":false,"fork":false,"pushed_at":"2017-04-13T20:50:46.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T21:28:30.413Z","etag":null,"topics":["input","input-validation"],"latest_commit_sha":null,"homepage":null,"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/gpestana.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-04-11T11:19:07.000Z","updated_at":"2017-04-13T20:49:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f94fce1c-9a46-49e7-9d2f-c788885846a5","html_url":"https://github.com/gpestana/nosix","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"908f855f878fa8aaa92b22e734097e5001ad92fc"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpestana%2Fnosix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpestana%2Fnosix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpestana%2Fnosix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpestana%2Fnosix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpestana","download_url":"https://codeload.github.com/gpestana/nosix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246087958,"owners_count":20721607,"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":["input","input-validation"],"created_at":"2024-10-02T02:10:07.112Z","updated_at":"2025-03-28T19:29:25.474Z","avatar_url":"https://github.com/gpestana.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## nosix.js\n\nnosix.js abstracts input validation, making it easier and straighforward for\nyou to validate any type of input. \n\nYou run nosix by providing a list of validator functions and an input. nosix\nwill test the input against the validators and return the results.\n\nIf the input fails to pass one of more validators, \nthe result will be an object with the validation errors. You can initialize \nnosix.js with a set of validators and add/remove validators at run time.\n\nBy default, Nosix works async. You may also run Nosix in a sync mode.\n\n### Instalation\n\n```\nnpm install nosix\n```\n\n### How to use nosix.js\n\n```javascript\nconst nosix = require('nosix');\n\nconst fn1 = input =\u003e typeof input == 'string' ? true : `${input} must be a string`;\nconst fn2 = input =\u003e input != '' ? true : `${input} cannot be empty`;\n\nconst stringInput = \"a random string\";\nconst objInput = { random: \"object\" };\n\n// validate async\nnosix.validate(stringInput, [fn1, fn2], err =\u003e {\n  if(!err) console.log('validation OK'); // validation OK\n});\n\n// validate sync\nconst err = validateSync(objectInput, [fn1, fn2]);\nconsole.log(err); // [ '[Object object] must be a string' ] \n```\n\nThe returned object `err` is null if there was no validation errors. Otherwise\nthe returned value is an array with all validation errors.\n\n### License:\n\nMIT © [Gonçalo Pestana](http:/gpestana.com/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpestana%2Fnosix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpestana%2Fnosix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpestana%2Fnosix/lists"}