amp-site-validator
Advanced tools
Comparing version 2.0.1 to 3.0.0
15
index.js
@@ -1,11 +0,14 @@ | ||
const pool = require('async-functions-pool')(); | ||
const createPool = require('async-functions-pool'); | ||
const amphtmlValidator = require('amphtml-validator'); | ||
const fetch = require('node-fetch'); | ||
module.exports = async (urlGenerator, parallel = 1) => { | ||
const validator = await amphtmlValidator.getInstance(); | ||
for(url of urlGenerator()){ | ||
pool.add(makeJob(validator, url)); | ||
module.exports = () => { | ||
const pool = createPool(); | ||
return async (urlGenerator, parallel = 1) => { | ||
const validator = await amphtmlValidator.getInstance(); | ||
for(url of urlGenerator()){ | ||
pool.add(makeJob(validator, url)); | ||
} | ||
return pool.run(parallel); | ||
} | ||
return pool.run(parallel); | ||
} | ||
@@ -12,0 +15,0 @@ |
{ | ||
"name": "amp-site-validator", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Full site AMP Pages validator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
![Current Version](https://img.shields.io/npm/v/amp-site-validator.svg) | ||
![NPM Minified size](https://img.shields.io/bundlephobia/min/amp-site-validator.svg) | ||
![Github Code Size](https://img.shields.io/github/languages/code-size/wjsc/amp-site-validator.svg) | ||
![Downloads/Week](https://img.shields.io/npm/dw/amp-site-validator.svg) | ||
![Downloads/Year](https://img.shields.io/npm/dy/amp-site-validator.svg) | ||
![Issues](https://img.shields.io/github/issues/wjsc/amp-site-validator.svg) | ||
@@ -11,3 +11,4 @@ ![License](https://img.shields.io/github/license/wjsc/amp-site-validator.svg) | ||
# amp-site-validator | Full site AMP Pages validator | ||
# amp-site-validator | ||
### Full site AMP validator | ||
@@ -18,4 +19,5 @@ If you publish your pages in AMP, you want to be sure any change does not affect your AMP performance. How? Setup a function generator that returns all URLS you want to validate and test them with the official Google's validator. | ||
``` | ||
// 1. Import module | ||
const validator = require('amp-site-validator'); | ||
// 1. Import module and create a Validator | ||
const createValidator = require('amp-site-validator'); | ||
const validator = createValidator(); | ||
@@ -22,0 +24,0 @@ // 2. Create your own url generator |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4863
16
62