html-validator
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -16,3 +16,3 @@ #!/usr/bin/env node | ||
console.log('Usage:'); | ||
console.log(' $ html-validate <url>'); | ||
console.log(' $ html-validator <url>'); | ||
console.log(''); | ||
@@ -24,3 +24,3 @@ console.log('Or:'); | ||
console.log('Valid options: json, html, xhtml, xml, gnu and text (default)'); | ||
console.log(' $ html-validate <url> --format=<format>'); | ||
console.log(' $ html-validator <url> --format=<format>'); | ||
} | ||
@@ -27,0 +27,0 @@ |
10
index.js
var request = require('request') | ||
, validUrl = require('valid-url') | ||
, userAgent = 'html-validator v0.0.7' | ||
, userAgent = 'html-validator v0.0.8' | ||
; | ||
@@ -12,3 +12,5 @@ | ||
}, | ||
qs: {out:opts.format}, | ||
qs: { | ||
out:opts.format || 'json' | ||
}, | ||
method: 'GET' | ||
@@ -39,6 +41,2 @@ }; | ||
if(!opts.format){ | ||
return callback(new Error('Missing required param: format'), null) | ||
} | ||
if(!opts.url && !opts.data){ | ||
@@ -45,0 +43,0 @@ return callback(new Error('Missing required params: url or data'), null) |
{ | ||
"name": "html-validator", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Validate html using validator.w3.org/nu", | ||
@@ -24,2 +24,6 @@ "author": { | ||
], | ||
"keywords": [ | ||
"html-validator", | ||
"validation" | ||
], | ||
"repository": { | ||
@@ -34,9 +38,9 @@ "type": "git", | ||
"dependencies": { | ||
"minimist": "^0.1.0", | ||
"request": "^2.36.0", | ||
"minimist": "^1.1.0", | ||
"request": "^2.42.0", | ||
"valid-url": "^1.0.9" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^1.18.2" | ||
"mocha": "^1.21.4" | ||
} | ||
} | ||
} |
@@ -26,3 +26,3 @@ #html-validator [](https://travis-ci.org/zrrrzzt/html-validator) | ||
**format** This is the formatting of the returned data and it is required. It supports json, html, xhtml, xml, gnu and text. | ||
**format** This is the formatting of the returned data. It supports json (default), html, xhtml, xml, gnu and text. | ||
@@ -37,3 +37,3 @@ **validator** You can override the default validator as long as it exposes the same REST interface. | ||
url : 'http://url-to-validate.com', | ||
format : 'json' | ||
format : 'text' | ||
}; | ||
@@ -55,3 +55,3 @@ | ||
, opts = { | ||
format : 'json' | ||
format : 'text' | ||
}; | ||
@@ -81,3 +81,3 @@ | ||
validator: 'http://html5.validator.nu', | ||
format : 'json' | ||
format : 'text' | ||
}; | ||
@@ -134,2 +134,2 @@ | ||
$ html-validator <url> --validator='http://html5.validator.nu' | ||
``` | ||
``` |
5823
93
130
+ Addedminimist@1.2.8(transitive)
- Removedminimist@0.1.0(transitive)
Updatedminimist@^1.1.0
Updatedrequest@^2.42.0