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

meadow-graph-client

v1.0.1

Published

Meadow graph client for pulling sets of records and comprehensions.

Downloads

91

Readme

meadow-graph-client

Meadow client pulling comprehensions of data from relational database graphs.

Concepts

  • Entity
  • Filter
  • Pagination
  • Hints
  • Ignores

Preparation

Before any graph requests can be made, a data model needs to be loaded.

This can be done in three ways:

  1. by passing in the data model as part of the service options in the DataModel property
  2. as a direct function call with the meadow schema object to graphClientService.loadDataModel(MyMeadowSchema);
  3. as discrete table adds with each meadow table schema you want to load with graphClientService.addTableToDataModel(MyMeadowTableSchema);

As these are loaded, the library creates the connection map for how entities are connected to each other.

There are some meadow-specific nomenclatures that are used to hint the graph creation and traversal:

  1. identity columns are prefaced by ID -- for instance IDBook, IDAuthoer, etc. (and these correlate with the table name)
  2. join tables are postfixed by Join -- for instance BookAuthorJoin is a join between Book and Author

By default the library ignores auditing columns (CreatingUserID, UpdatingUserID, CustomerID, etc.) and will not use them to build graph query lookups.

Basic Algorithm

The graph traversal happens in a forwards then backwards manner, building context and then resolving connections coming back.

  1. Lint Filter Object
  2. Parse the Filters
  3. Generate the Request Graph
  4. Perform the Request Graph outside in

Some Complex Tasks

  • Determining whether or not the filter is in the current entity (and if not, which one)
  • Walk the graph of potential entities to apply the filter to, and scoring them (distance being a huge factor)
  • Converting Filters to their complex filter descriptions (this one is complex because it has to resolve based on ambiguity at times (for instance if you filter on Name but there is no Name column in the queried entity but three of the potential joins have a Name column... which is part of why there is hinting)
  • Once the graph requirements have been built, pull record sets in reverse-style (for instance if I'm getting all Books by a specific Author Name, we will gather the Author first then the books and the join inbetween if that join exists in the data model)

Filters

  • Each filter has a type
  • Right now there are two types: InRecord and Join
  • Filters have a comparison operator -- defaulted to Equal

A simple direct search of an entity with equivalent filters

Longhand form:

{
    Entity: 'Book',
    Filters: {
        Name: { FilterType: 'InRecord', Comparison: 'Equality', Value: 'Breakfast of Champions' }
    }
}

Shorthand form:

{
    Entity: 'Book',
    Filters: {
        Name: 'Breakfast of Champions'
    }
}

Both of these resolve into:

{
    Entity: 'Book',
    Filters: [
        {
            Hash: 'Name',
            Entity: 'Book',
            FilterType: 'InRecord',
            Column: 'Name',
            Comparison: 'Equality',
            Value: 'Breakfast Of Champions'
        }
    ]
}

Note that filters do not have to have the object key map to the Column name... this is just a convenience for shorthand. You can explicitly define the Column as well with:

{
    Entity: 'Book',
    Filters: {
        NameIsIrrelevant: { Column: 'Name', FilterType: 'InRecord', Comparison: 'Equality', Value: 'Breakfast of Champions' }
    }
}

Which will resolve to:

{
    Entity: 'Book',
    Filters: ...one of the two Filters objects from above...,

    EntitiesToPull: ['Book']
    ParsedFilters: [
        {
            Hash: 'NameIsIrrelevant',
            FilterType: 'InRecord',
            Column: 'Name',
            Comparison: 'Equality',
            Value: 'Breakfast Of Champions',
        }
    ]
}

The possible (but not definite) correlation between Hash and Column adds complexity. And. Gives an interesting interaction with Manyfests which use a similar type of potential indirection.

Some equivalent filters for an entity that is a single dimension away

Longhand form:

{
    Entity: 'Book',
    Filters: {
        IDAuthor: { FilterType: 'Join', Value: 157 }
    }
}

Shorthand form:

{
    Entity: 'Book',
    Filters: {
        IDAuthor: 157
    }
}

Related Packages

  • meadow - Data access and ORM
  • fable - Application services framework

License

MIT

Contributing

Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the Retold Contributing Guide.