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

@sanity/descriptors

v1.3.0

Published

_Descriptors_ is a way of serializing definitions (e.g. schema types) so they can be easily shared across Content Lake. It has the following characteristics:

Readme

Descriptors

Descriptors is a way of serializing definitions (e.g. schema types) so they can be easily shared across Content Lake. It has the following characteristics:

  • JSON native: A descriptor is encoded using JSON with support for the typical JSON values: Objects, arrays, strings, booleans, floats.
  • Content-addressable: Each descriptor has an id which is the SHA-256 hash of the contents. The same descriptor will always end up with the same id.
  • Recursively defined: It's common for descriptors to refer to other descriptors by their id. That way you can refer to a whole graph of interconnected descriptors by a single root id. This is very similar to how a blockchain works, but without the utter waste of energy.
  • Efficient synchronization: The format is designed so that it's possible to efficiently synchronize when there's only been a few changes on the client-side. This is possible without the client storing any additional information about the state of the server.

Here's an example of two descriptors: One named schema type, and then one schema registry which ties it together (so that recursively defined types can be represented).

{
  "id": "uEiA4r6C4bPFx1dMadoWeZ4ZJxLLXGzeNojZIsnGxp6g0rw",
  "type": "sanity.schema.registry"
  "content": [
    "uEiDPWicraeaSOVaZEUlyrF6RFDRURU4XCLsNR7zCLoNAcg",
    "uEiChs9ZdIsaYe7KLKSVk3b1yApMvlHIO8UvebgjJYTUMAQ"
  ]
}

{
  "id": "uEiChs9ZdIsaYe7KLKSVk3b1yApMvlHIO8UvebgjJYTUMAQ",
  "type": "sanity.schema.namedType",
  "name": "username",
  "typeDef": {
    "subtypeOf": "string",
    "title": "Username"
  }
}

Usage

Once a client has built a descriptor it can send it into Content Lake and then start using the ID towards other services. It's important to realize that "sending it into Content Lake" doesn't make it visible anywhere. Studio can upload the schema into Content Lake and the only thing that happens is that now it can use the schemaId towards e.g. Agent Action. The concept of for instance saying "dataset X has schema Y" is not solved here. What we're dealing with here is how to represent that schema on the server-side and being able to refer to it.

Further documentation

To learn more:

  • docs/format.md describes the overall structure of the format.
  • docs/sync.md describes the efficient synchronization protocol.
  • playground/ is a demo application which shows the synchronization protocol.