{"id":22747193,"url":"https://github.com/one-com/purify","last_synced_at":"2025-04-14T11:40:29.921Z","repository":{"id":12497275,"uuid":"15166839","full_name":"One-com/purify","owner":"One-com","description":"Validation library for node.js","archived":false,"fork":false,"pushed_at":"2023-10-25T11:35:14.000Z","size":42,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-11T13:09:35.004Z","etag":null,"topics":[],"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/One-com.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}},"created_at":"2013-12-13T15:23:00.000Z","updated_at":"2024-01-02T10:36:33.000Z","dependencies_parsed_at":"2023-12-19T12:07:48.608Z","dependency_job_id":"c0aa3524-421c-4e23-b38d-004a4f47032b","html_url":"https://github.com/One-com/purify","commit_stats":{"total_commits":64,"total_committers":7,"mean_commits":9.142857142857142,"dds":0.609375,"last_synced_commit":"fef628e8601b8f8896f1e233562988a29be11f27"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fpurify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fpurify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fpurify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/One-com%2Fpurify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/One-com","download_url":"https://codeload.github.com/One-com/purify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248874209,"owners_count":21175791,"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-12-11T03:13:38.211Z","updated_at":"2025-04-14T11:40:29.889Z","avatar_url":"https://github.com/One-com.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"purify\n======\n\n[![NPM version](https://img.shields.io/npm/v/purify)](https://www.npmjs.com/package/purify)\n[![Build Status](https://travis-ci.org/One-com/purify.svg?branch=master)](https://travis-ci.org/One-com/purify)\n[![Coverage Status](https://coveralls.io/repos/github/One-com/purify/badge.svg?branch=master)](https://coveralls.io/github/One-com/purify?branch=master)\n[![Dependency Status](https://david-dm.org/One-com/purify.svg)](https://david-dm.org/One-com/purify)\n\nThe library provides a number of battle tested validation functions. Each returns the\nvalue supplied or a `defaultValue`. Mostly, you can leave `defaultValue` empty, which\nwill cause purify to return `undefined` in case the value doesn't pass validation.\n\nUsage\n-----\n\nThe library can be installed by simply installing `purify` from npm and can be used\nbody on node with `require('purify')` or as a self-contained UMD browser bundle that\ncan be used directly in a script tag as follows:  \n`\u003cscript src=\"./node_modules/lib/purify.js\"\u003e`\n\nExample\n-------\n\n```javascript\nvar app = express(),\n    purify = require('purify');\n\napp.get('/:userId', function (req, res, next) {\n    var userId = purify.positiveInteger(req.param('userId')),\n        force = purify.boolean(req.param('force'), true);\n\n    if (userId) {\n        // ...\n    } else {\n        res.send(400);\n    }\n});\n```\n\nAPI\n---\n\n* `.email(rawValue, defaultValue)`\n* `.emailIdn(rawValue, defaultValue)` - Returns e-mail with non-punycoded form regardless of input.\n* `.domainName(rawValue, defaultValue)`\n* `.domainNameIdn(rawValue, defaultValue)` - Returns domain in non-punycoded form regardless of input.\n* `.url(rawValue, defaultValue)`\n* `.urlWithLocalhost(rawValue, defaultValue)`\n\n* `.integer(rawValue, defaultValue)`\n* `.integerInRange(rawValue, lower, upper, defaultValue)`\n* `.positiveInteger(rawValue, defaultValue)`\n* `.positiveIntegerOrZero(rawValue, defaultValue)`\n* `.float(rawValue, defaultValue)`\n* `.positiveFloat(rawValue, defaultValue)`\n* `.positiveFloatOrZero(rawValue, defaultValue)`\n\n* `.nonEmptyVisibleUnicode(rawValue, defaultValue)`\n* `.visibleUnicode(rawValue, defaultValue)`\n* `.nonEmptyPrintableUnicode(rawValue, defaultValue)`\n* `.printableUnicode(rawValue, defaultValue)`\n* `.nonEmptyVisibleAscii(rawValue, defaultValue)`\n* `.visibleAscii(rawValue, defaultValue)`\n* `.nonEmptyPrintableAscii(rawValue, defaultValue)`\n* `.printableAscii(rawValue, defaultValue)`\n\n* `.alphaNumeric(rawValue, defaultValue)`\n* `.nonEmptyAlphaNumeric(rawValue, defaultValue)`\n* `.alphaNumericWithDot(rawValue, defaultValue)`\n\n* `.uuid(rawValue, defaultValue)`\n* `.upperCaseUuid(rawValue, defaultValue)`\n* `.lowerCaseUuid(rawValue, defaultValue)`\n\n* `.json(rawValue, defaultValue)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fpurify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fone-com%2Fpurify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fone-com%2Fpurify/lists"}