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

@occultist/mini-jsonld

v0.0.1

Published

A minimal incomplete JSON-LD expansion algorithm

Readme

Occultist JSON-LD expand

This is a WIP implementation of the JSON-LD expand algorithm albeit with some differences in its output when compared to jsonld.js.

Typically jsonld.js will wrap all non-array values within arrays to make the data structure more regular for later processing. You can test this behaviour in the JSON-LD.org playground. The @occultist/mini-jsonld expand implementation only expands properties, it largely does not create extra arrays or nest scala values within @value objects, unless the value was presented in such form in the input data.

Why

The Octiron and Occultist.dev projects require a JSON-LD expansion algorithm. jsonld.js provides that, and a lot of other functionality that is useful for its creators and other sem-web projects. This implementation focuses on being small, fast and it creates a less verbose output that Octiron and Occultist.dev are happy with. It is possible that developers might have to work with the output of the expansion algorithm, and for developers who might want to experiment with the Octiron.dev framework and are unfamiliar with JSON-LD, the less change from the authored payload the less confusing adpotion will be.

Goal

This project is one of many priorities under the Occultist.dev banner. In the short term a minimal and incomplete expansion algorithm will be developed to get good enough output for projects built with Occultist.dev. In the future a complete implementation might be developed, but currently this is not on the roadmap.

Install

npm add @occultist/mini-jsonld

Usage

Many JSON-LD features are untested but the basic job of expanding object properties, '@type' values and '@id' values is implemented.

import { expand, JSONLDContextStore } from '@occultist/mini-jsonld';

// optionally allow caching of remote contexts
// a fetcher function can also be passed in to
// alter the fetch behaviour.
const store = new JSONLDContextStore({ cacheMethod: 'cache' });

const expanded = await expand({
  '@context': {
    'id': '@id',
    '@vocab': 'https://schema.org/',
  }
  'id': 'https://example.com/foo',
  'name': 'Matthew Quinn',
  'website': 'https://matthewquinn.me',
}, { store });

console.log(expanded);
// {
//   "@id": "https://example.com/foo",
//   "https://schema.org/name": "Matthew Quinn",
//   "https://schema.org/website": "https://matthewquinn.me",
// }

Current working features

These features are some-what tested and appear to be working well. Un-mentioned JSON-LD features may have partial support but should not be relied on for now.

Context parsing

Strait-forward context objects appear to work well. The logic for aliasing is non-recursive and is likely to not work for complex use-cases.

Property type and IRI expansion

This algorithm will recursively expand all object properties, object @type values and object @id values. It uses the @vocab defined in the active context and any aliases when doing so.

Fetching remote contexts

Remote contexts will be fetched and merged if required. The merge behaviour is a quick implementation and has not been checked against the JSON-LD spec.