Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-amphtml-validator with all npm packages installed. Try it out:

var gulpAmphtmlValidator = require("gulp-amphtml-validator")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-amphtml-validator v1.0.2

Gulp plugin for the official AMP HTML validator (

Gulp AMPHTML Validator

A Gulp plugin for validating AMPHTML files using the official AMPHTML Validator.


Install package with NPM and add it to your development dependencies:

npm install --save-dev gulp-amphtml-validator


const gulpAmpValidator = require('gulp-amphtml-validator');

gulp.task('amphtml:validate', () => {
  return gulp.src('*.html')
    // Validate the input and attach the validation result to the "amp" property
    // of the file object. 
    // Print the validation results to the console.
    // Exit the process with error code (1) if an AMP validation error
    // occurred.

To treat warnings as errors, replace the last line of the validation closure with:

// Exit the process with error code (1) if an AMP validation warning or
// error occurred.

Release Notes


  • Add failAfterWarningOrError option
  • Upgrade amphtml-validator version to 1.0.21


  • Upgrade amphtml-validator version to 1.0.18


  • initial release


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free