import FeedParser from 'feedparser'
import {pipeline} from 'stream/promises'
import {createReadStream} from 'fs'
let feedparser = new FeedParser()
await pipeline(createReadStream(process.argv[2]), feedparser)
I get
$ node --throw-deprecation DEP0170.js lol.xml
node:internal/process/warning:185
throw warning;
^
DeprecationWarning: The URL tag:mefi.social,2024-01-26:objectId=20368395 is invalid. Future versions of Node.js will throw an error.
at getHostname (node:url:516:17)
at Url.parse (node:url:384:14)
at urlParse (node:url:141:13)
at Url.resolve (node:url:722:29)
at Object.urlResolve [as resolve] (node:url:718:40)
at /mnt/hdd3/Downloads/DEP0170/node_modules/feedparser/lib/utils.js:148:46
at Array.forEach (<anonymous>)
at /mnt/hdd3/Downloads/DEP0170/node_modules/feedparser/lib/utils.js:145:19
at Array.forEach (<anonymous>)
at resolveLevel (/mnt/hdd3/Downloads/DEP0170/node_modules/feedparser/lib/utils.js:120:9) {
code: 'DEP0170'
}
I stumbled upon this while parsing a mastodon feed (I saved the example here). A minimal variant of an unfourtunate feed boils down to
If I parse such xml with feedparser 2.2.1
I get