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

@sparq-org/eyereasoner-compat

v0.1.0

Published

Drop-in migration package for eye-js (eyereasoner): the same n3reasoner API, backed by sparq's native Notation3 forward-chaining reasoner compiled to WebAssembly. Lighter browser payload, no SWI-Prolog.

Readme

@sparq-org/eyereasoner-compat

A drop-in migration package for eye-js: the same n3reasoner(data, query?, options?) API, backed by sparq's native Notation3 forward-chaining reasoner compiled to WebAssembly — no SWI-Prolog, and a lighter browser payload. Migrating is a one-line package.json change.

🚀 Quickstart

npm install @sparq-org/eyereasoner-compat
import { n3reasoner } from '@sparq-org/eyereasoner-compat';

const data = `
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix : <http://example.org/socrates#>.
:Socrates a :Human.
:Human rdfs:subClassOf :Mortal.
{?A rdfs:subClassOf ?B. ?S a ?A} => {?S a ?B}.`;

const query = `@prefix : <http://example.org/socrates#>. {:Socrates a ?WHAT} => {:Socrates a ?WHAT}.`;

await n3reasoner(data, query);   // => ":Socrates a :Human, :Mortal" (as N-Triples)
await n3reasoner(data);          // => all inferred (derivations)

The wasm engine ships inside the tarball and loads with no configuration (Node reads it from disk; browsers/CDNs resolve it relative to the module). No network fetch of a hosted asset.

CDN usage (no bundler)

<script type="module">
  import { n3reasoner } from 'https://esm.sh/@sparq-org/eyereasoner-compat';
  console.log(await n3reasoner('@prefix : <http://ex/>. {:a a :A} => {:a a :B}. :a a :A.'));
</script>

Also available via https://cdn.jsdelivr.net/npm/@sparq-org/eyereasoner-compat/+esm and https://unpkg.com/@sparq-org/eyereasoner-compat. If a bundler cannot auto-resolve the wasm, point at it explicitly: import { configureWasm } from '...'; configureWasm(new URL(...)); before the first call.

✨ Features

  • n3reasoner — the eye-js drop-in. Same overloads: string/[string,…]string, Quad[]Quad[] (RDF/JS), overridable with options.outputType: 'string' | 'quads'. String output is canonical N-Triples (a valid Turtle/N3 subset).

  • Output modes (options.output, query-less calls):

    | mode | eye-js flag | sparq backing | status | | --- | --- | --- | --- | | derivations (default) | --pass-only-new | newly-derived triples only | ✅ | | deductive_closure | --pass | full ground closure | ✅ | | none | — | empty result | ✅ | | deductive_closure_plus_rules | --pass-all | — | ❌ throws (deferred) | | grounded_deductive_closure_plus_rules | --pass-all-ground | — | ❌ throws (deferred) |

    The …_plus_rules modes echo the rules into the output; sparq's chainer consumes rules and emits only ground triples, so they fail loudly rather than return a different result set.

  • Query filter. A query { premise } => { conclusion } becomes a SPARQL CONSTRUCT over the closure (EYE --query semantics). Combining an explicit output with a query throws, as in eye-js. Query rules using builtins / quoted formulae / lists fail closed (a clear error, never a silently wrong answer) — tracked for a follow-up.

  • Builtins coverage (honest). sparq's N3 engine supports a subset of EYE's library: math: (sum, difference, product, quotient, greaterThan, lessThan, equalTo, …), string: (concatenation, contains, startsWith, endsWith, matches, replace, …), list: (member, append, memberCount, first, last, …), time: and log: core. EYE's full builtin library is larger; a rule using an unsupported builtin simply does not fire (and in a query rule it fails closed). See skills/inference/SKILL.md.

  • SWIPL/EYE-image surface → migration stubs. SwiplEye, loadEyeImage, loadImage, runQuery, buildQuery, qaQuery, query, queryOnce, executeBasicEyeQuery, linguareasoner, EYE_PVM are re-exported so imports compile, but throw a clear migration error — they are inherently SWI-Prolog-bound and cannot be backed by sparq. The SWIPL / cb options are accepted and warn-and-ignore.

  • Lighter payload. The single wasm asset is markedly smaller than eye-js's SWI-Prolog build (swipl-web.wasm + swipl-web.data, ~3.83 MB combined). Reproduce the exact bytes:

    wasm-pack build ../../crates/sparq-reason-wasm --target web --release
    f=../../crates/sparq-reason-wasm/pkg/sparq_reason_wasm_bg.wasm
    echo "raw: $(stat -c%s "$f")  gzip -9: $(gzip -9 -c "$f" | wc -c)"

📚 Learn more

License

MIT.