amphtml-validator-extra
Enhanced package of amphtml-validator.
It is possible to designate multiple URLs and file paths and verify them all together.
Use
const amphtmlValidator = ;const urls = 'https://example.com/article-01.html?amp' 'https://example.com/article-02.html?amp' 'https://example.com/article-03.html?amp'; amphtmlValidator;// [// status: 'PASS'// errors: [...]// ],// [// status: 'FAIL',// errors: [...]// ],// ...
Methods
validateHtml
amphtmlValidator;
Argment | Type | Description |
---|---|---|
html | string |
AMP HTML sourde |
validateUrl
let urls = 'https://example.com/article-01.html?amp' 'https://example.com/article-02.html?amp' 'https://example.com/article-03.html?amp'; amphtmlValidator;
Argment | Type | Description |
---|---|---|
urls | array or string |
AMP Page URL. |
option.auth.user | string |
Basic auth user name. |
option.auth.password | string |
Basic auth password. |
option.progress | function |
Progress callback function. |
validateFile
let urls = './test/article-01.html' './test/article-02.html' './test/article-03.html'; amphtmlValidator;
Argment | Type | Description |
---|---|---|
urls | array or string |
AMP Page URL. |
option.progress | function |
Progress callback function. |
Option
Progress callback function.
progress
let urls = 'https://example.com/article-01.html?amp' 'https://example.com/article-02.html?amp' 'https://example.com/article-03.html?amp';let option = { console; }; amphtmlValidator;/* * 1 / 3 * 2 / 3 * 3 / 3 */
auth
let urls = 'https://example.com/auth/article-01.html?amp' 'https://example.com/auth/article-02.html?amp' 'https://example.com/auth/article-03.html?amp'; amphtmlValidator;