An HTTP client for fetching Linked Data RDF resources in Node.js and the browser. Current stable version is 1.2.8. It enhances standard fetch by setting appropriate Accept headers for RDF serializations, uses rdf-parse to support multiple RDF formats, returns triples/quads in RDFJS representation, and emits events for request lifecycle. It automatically follows redirects, supports HTTP caching, and can limit concurrent requests. The CLI tool can output TriG or use JSON-LD framing. Key differentiators: single library for both Node.js and browser, event-driven, and built on top of rdf-parse for broad format support.
npm install ldfetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import ldfetch, fetch a URL, access triples, and use JSON-LD framing.
Use: new ldfetch({}) instead of new ldfetch(url)Access triples via response.triples, not response.data
Use <script src="dist/main.js"></script> and new window.ldfetch()
Use import ldfetch from 'ldfetch'
Call fetch.frame(response.triples, frameObject)
Use: import ldfetch from 'ldfetch' (not { ldfetch })Add <script src="dist/main.js"></script> before using window.ldfetch
Run: npm install ldfetch
Access response.triples, but ensure the promise resolved correctly; check network.