PostXML plugin for adding alt attributes to images.
npm i postxml-imgalt --save-dev
var fs = require('fs'),
postxml = require('postxml'),
plugin = require('postxml-imgalt');
var html = fs.readFileSync('input.html', 'utf8');
var output = postxml(
html,
[
plugin()
]
);
<img src="image.png">
<img src="image.png" alt="">
MIT