node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

ampit

AMP-It

AMP-It is a node module that automates the process of converting a HTML file into an AMP complient file.

const ampIT = require('../dist/main');
var content = '<html></html>' //HTML File
 
let ampHTML = ampIT(content);
 
console.log(newhtml);
//Returns AMP Complient HTML

AMPIT(String); The Following Example will return AMP Complient HTML.

Installation

npm install Amp-It

Information

AMP-It first runs your provided HTML into the AMP Validator Module. It then gathers all AMP errors into an array. AMP-It then goes through the errors and corrects them according to the type of error. Once the corrections are made, AMP-It runs the corrected code into the AMP Validator just to double check. As of now AMP-IT returns the HTML as a string. (Soon to return an AMP HTML file)
See https://www.ampproject.org/docs/reference/spec for AMP Specifications

Testing

No Testing Yet

Dependencies

License

MIT