Installations
npm install amp-site-validator
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.9.0
NPM Version
6.4.1
Score
56.3
Supply Chain
75.4
Quality
74.9
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
143,898
Last Day
3
Last Week
23
Last Month
154
Last Year
16,004
GitHub Statistics
14 Commits
2 Forks
1 Watching
1 Branches
2 Contributors
Bundle Size
55.13 kB
Minified
17.59 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0
Package Id
amp-site-validator@3.0.0
Unpacked Size
4.75 kB
Size
2.26 kB
File Count
4
NPM Version
6.4.1
Node Version
8.9.0
Total Downloads
Cumulative downloads
Total Downloads
143,898
Last day
0%
3
Compared to previous day
Last week
4.5%
23
Compared to previous week
Last month
-13.5%
154
Compared to previous month
Last year
-75.5%
16,004
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
amp-site-validator
Full site AMP validator
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.
Usage
// 1. Import module and create a Validator
const createValidator = require('amp-site-validator');
const validator = createValidator();
// 2. Create your own url generator
const urlGenerator = function* (){
for(let i=1; i < 200; i++){
yield 'https://yourSite.com/page/'+i;
}
}
// 3. Set the number of parallel jobs and validate!
async function run(){
// This will fetch and validate 10 pages at the same time
const results = await validator(urlGenerator, 10);
console.log(results);
}
run();
Another way to create a generator?
const urlGenerator = function* (){
yield 'https://yourSite.com/page/1';
yield 'https://yourSite.com/page/2';
yield 'https://yourSite.com/page/3';
yield 'https://yourSite.com/page/4';
yield 'https://yourSite.com/page/5';
yield 'https://yourSite.com/page/6';
}
How to count correct and failed pages ?
console.log('Valid pages : '+ results.filter( result => result.status === 'PASS').length)
console.log('Invalid pages : '+ results.filter( result => result.status !== 'PASS').length)
FAQs
- How minimal it is? Less than 20 lines of code
- Which version of Node is required? > 8.0.0 because it uses async/await
- Where to find more documentation? Visit Google's official docs: https://www.npmjs.com/package/amphtml-validator
- What's a function generator ? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 3 are checked with a SAST tool
Score
2.8
/10
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More