npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lde/distribution-probe

v0.1.2

Published

Probes a DCAT `Distribution` to check availability and gather metadata. Returns `SparqlProbeResult`, `DataDumpProbeResult`, or `NetworkError` – the probe never throws.

Downloads

334

Readme

Distribution Probe

Probes a DCAT Distribution to check availability and gather metadata. Returns SparqlProbeResult, DataDumpProbeResult, or NetworkError – the probe never throws.

import { Distribution } from '@lde/dataset';
import { probe } from '@lde/distribution-probe';

const distribution = new Distribution(
  new URL('https://example.org/data.ttl'),
  'text/turtle',
);
const result = await probe(distribution);

Behaviour

SPARQL endpoints

Sends POST with SELECT * { ?s ?p ?o } LIMIT 1 and Accept: application/sparql-results+json, then:

  • Content-Type is enforced. The response Content-Type must start with application/sparql-results+json; anything else fails the probe (isSuccess() === false). This rules out HTML error pages served with 200 OK.
  • The JSON body must parse and contain a results object. Empty bodies, invalid JSON, and missing results all fail the probe with a failureReason.

Data dumps

Sends HEAD with Accept: <distribution.mimeType> and Accept-Encoding: identity. If Content-Length is missing or ≤ 10 KB, retries with GET to validate the body – this also catches servers that return 0 from HEAD.

  • Content-Type is checked as a soft warning, not a hard failure. If the server’s Content-Type disagrees with the distribution’s declared mimeType, a message is appended to result.warnings but isSuccess() stays true. Compression wrappers (application/gzip, application/x-gzip, application/octet-stream) are skipped so a gzipped Turtle file doesn’t trigger a warning.
  • Body is parse-validated only for Turtle, N-Triples, and N-Quads (Content-Type starting with text/turtle, application/n-triples, or application/n-quads). Empty bodies and parse errors fail the probe. Other RDF serializations (RDF/XML, JSON-LD, TriG, …) are not parse-validated – only HTTP status and headers are checked.
  • Bodies larger than 10 KB are not fetched; only HEAD metadata is inspected.

Network errors

Any thrown exception from fetch (DNS, connection refused, TLS, timeout after the configured timeout – default 5 000 ms) is caught and returned as a NetworkError with the original message.