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

@iresine/core

v1.0.14

Published

@iresine/core is a library for normalize and notify about updates.

Downloads

20

Readme

@iresine/core

@iresine/core is a library for normalize and notify about updates.

99% of the time, you shouldn't use @ iresine/core directly. At the moment, I recommend using @iresine/core with @iresine/react-query

Install

npm i @iresine/core

API

type Entity = any

Entity that has an identifier

types EntityId = string

for this entity

{
  id: '0',
  type: 'user'
}

entityId is

'user:0';
type Template = Array<Array<string, any>>

Array of arrays where the first value contains the path, and the second value contains the value

const iresine = new Iresine();
const data = {
  deep: {
    level: {
      0: 'hello',
    },
  },
};

const {template} = iresine.parse(data);

// templte now have structure
// [
//  [[], {}], first array is structure of base
//  [['deep', 'level', '0'], 'hello']
// ]
type Refs = Map<Array, EntityId>

Map, there keys are paths to the place where the link to another entity is located. Values are the identifier of the entity we are referring to.

const iresine = new Iresine();
const data = {
  deep: {
    level: {
      0: {
        id: 0,
        type: 'comment',
      },
    },
  },
};

const {refs} = iresine.parse(data);

// refs now have structure
// new Map([
//  [['deep', 'level', '0'], 'user:0']
// ])
parse(entity: Entity): {template: Template, refs: Refs}

The main function that parses data and stores it in storage. Upon completion, it notifies all required subscribers.

get(EntityId: EntityId): Entity

Get an entity by its identifier

const iresine = new Iresine();
const user = {
  id: '0',
  user: 'user',
};

iresine.parse(user);
iresine.get('user:0') === user; // true
join(EntityId: EntityId): Entity

Get an entity by its identifier. Unlike .get() creates a new entity when called. The new entity is stored in the store.

const iresine = new Iresine();
const user = {
  id: '0',
  user: 'user',
};

iresine.parse(user);
iresine.get('user:0') === user; // false, but have same structure
joinRefs(template: Template, refs: Refs)

Concatenates values from template, substituting entities from refs

const iresine = new Iresine();
const data = {
  deep: {
    level: {
      0: {
        id: 0,
        type: 'comment',
      },
    },
  },
};

const {template, refs} = iresine.parse(data);
const joined = iresine.joinRefs(template, refs);
joined === data; // false, but have same structure
subscribe(EntityIds: []EntityId, listener)

Subscribes to changes.

unsubscribe(EntityIds: []EntityId, listener)

Unsubscribes to changes.