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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@octiron/octiron

v0.0.5

Published

WIP framework for mithril.js and json-ld APIs.

Readme

Octiron

Octiron is a frontend framework that can make selections from linked-data APIs communicating in JSON-ld. Linked data is data with hyperlinks pointing to other related API endpoints, an Octiron selection is a list of properties (or types) which Octiron should traverse, within local data, or referenced API endpoints. If a selection links to another point in the linked-data API Octiron will automatically make the necessary API requests in order to complete its selection.

Once a selection reaches its terminal point a view function can be provided that has a new Octiron instance passed in holding the selected value. Further selections can be made from the point in the API referenced by the Octiron instance and Mithril vdom can be returned.

const o = new Octiron({
  apiRoot: 'https://example.com',
});

const vdom = o.select('some nested api thing', o =>
  m('h1', o.select('name', o => o.value))
);

Properties, (called types) of JSON-ld objects can be pre-configured with global type handlers. If no arguments are provided to the o.select() method after the seletion, the globally configured type handler will be used to render the value.

const PresentMeters = {
  view({ attrs: { value } }) {
    return value + 'm';
  }
};
const o = new Octiron({
  apiRoot: 'https://example.com',
  typeHandlers: {
    height: { present: PresentMeters },
  },
});

const vdom = o.select('empire states building', o =>
  m('dl',
    m('dt', 'Height'),
    // o.select('height') requires no futher arguments.
    m('dd', o.select('height')),
  )
);

Octiron can also build requests with parameters mapped to the URL and body of the request by performing actions. Supported actions share the shape of schema.org actions. Octiron will only render a o.perform() view if the API responds with a valid schema.org action object.

The o.initial() method renders its children if the action is in its initial state. The o.success() method injects an Octiron instance holding the response data which can have further selections performed on it.

The Octiron instance created from o.perform() is special. Any selections made against it render an edit component selecting from the payload. The o.select('search') in this example would render a search box if such a component had been configured globally.

The following is what a fully functional search form looks like when rendered using Octiron. The OctironForm component would render correct HTML in an SSR situration making the form work when Javascript is not available client side.

function recipeSearchForm(o: Octiron) {
  return o.perform('actions ListRecipesAction', o =>
    m(OctironForm, { o },
      m('.search-controls',
        o.select('search'),
      ),

      o.initial(m('p', m('strong', 'Search for a recipe'))),

      o.success(o => [
        o.not(isPopulated('members'),
          m('p', m('strong', 'No results')),
        ),

        o.select('members', o =>
          m('.card',
            m('.card-body.action-row',
              o.select('title', o => m('h3.start', o.present())),
              o.select('url', o => m('.end', o.present({
                attrs: {
                  text: 'View recipe',
                },
              }))),
            ),
          ),
        ),
      ]),

      m('.action-bar',
        m('button', 'Submit'),
      )
    ),
  );
}

Octiron is a work in progress framework and this description of its capibilities is far from complete.

Install

npm install npm:@octiron/octiron