If you are processing large documents and only need a few specific elements (like title or image), use extractor.lazy(html, language). This avoids the overhead of the full text extraction pipeline.
Unlike the standard extractor, which returns a JSON object, extractor.lazy returns an object where every field is a function. Evaluation is only performed when the function is called, and results are cached for subsequent calls.
Example:
const extractor = require('unfluff');
const data = extractor.lazy(my_html_data, 'en');
// Access elements by calling them as functions
console.log(data.title());
console.log(data.image());
console.log(data.text());