{"id":20285809,"url":"https://github.com/tpkn/w3v","last_synced_at":"2026-05-11T15:32:40.910Z","repository":{"id":74204169,"uuid":"121954244","full_name":"tpkn/w3v","owner":"tpkn","description":"Node.js wrapper for W3 Validator","archived":false,"fork":false,"pushed_at":"2019-07-16T13:45:38.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T08:12:50.646Z","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/tpkn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-18T13:26:54.000Z","updated_at":"2019-07-16T13:45:40.000Z","dependencies_parsed_at":"2023-02-27T06:01:45.186Z","dependency_job_id":null,"html_url":"https://github.com/tpkn/w3v","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/tpkn%2Fw3v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fw3v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fw3v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fw3v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpkn","download_url":"https://codeload.github.com/tpkn/w3v/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780512,"owners_count":20019061,"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-11-14T14:29:03.514Z","updated_at":"2026-05-11T15:32:35.888Z","avatar_url":"https://github.com/tpkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# W3V [![npm Package](https://img.shields.io/npm/v/w3v.svg)](https://www.npmjs.org/package/w3v)\nNode.js wrapper for W3 Validator\n\n\n## Installation\n```bash\nnpm install w3v\n```\n\n\n## Usage\n```javascript\nconst w3v = require('w3v');\n\nw3v(fs.readFileSync('is_valid.html', 'utf8'))\n.then(result =\u003e {\n   console.log('Result: ', result.message);\n   // '84 errors'\n\n   console.log('Errors list:', result.errors);\n   // ['line 44 -\u003e Quote “\"” in attribute name. Probable cause: Matching quote missing somewhere earlier.']\n})\n.catch(err =\u003e {\n   console.log(err);\n})\n```\n:warning: Beautified results are only supported for `json` format!\n\n\n### Set custom request params\nIf, for example, you want to change the server response format from `json` to [something else](https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out), you could overwrite the default request object:\n```javascript\nw3v('\u003chtml\u003e', {\n   request: {\n      url: 'https://validator.w3.org/nu/',\n      qs: {\n         out: 'json'\n      },\n      headers: {\n         'Content-Type': 'text/html; charset=utf-8',\n         'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36'\n      }\n   }\n})\n```\n\n### Filter the results\nIf you don't want to get the whole list of `errors`, you could specify the list of results you'd like to filter. There is no need to define the exact error text, just a part of it (searching method is `Array.indexOf`).\n```javascript\nw3v('\u003chtml\u003e', {\n   filters: [\n      'Element “title” must not be empty',\n      'A document must not include both a “meta” element'\n   ]\n})\n```\nPlease keep in mind that I've already set a number of my own filters, and their number will increase over time. To reset all my filters you could set `filters: []`.\n\n\n\n### Get raw results\nBy default this module cuts off `info` and `warning` from the results. So the `raw` parameter allows you to get the full server response without any changes:\n```javascript\nw3v('\u003chtml\u003e', {\n   raw: true\n})\n```\n\n\n## Resources\n- https://validator.w3.org/docs/api.html\n- https://github.com/validator/validator/wiki\n\n\n## Changelog \n#### 2018-02-18:\n- a bit simplified api\n- speed improvements\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fw3v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpkn%2Fw3v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fw3v/lists"}