Adding sugar to Node.js project with Apricot in it:
https://github.com/silentrob/Apricot
...makes this loop through with value "src" as output, not the actual src-attribute value:
var apricot = require('apricot').Apricot,
sugar = require('sugar');
apricot.parse(body, function(err, doc) {
doc.find('img');
doc.each(function(img) {
console.log(img.src);
});
});
What's the best practice to disable Sugar.js version of Array#each?
P.S. Removing sugar and it works for the record if that was unclear.