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

@dosvit/api-gateway

v1.1.1-rev.6

Published

To use with local development services, add `LOCAL=true` to `.env` and list your services in `services.json`

Readme

To use with local development services, add LOCAL=true to .env and list your services in services.json

Pull data from another service

Users pulls books by adding book to a user:

# BooksBook MUST have the same structure as external type
# reduced to key fields (e.g. {id} or {topic: {id}}) and, optionally, denrmalized fields 
type User @key(fields: "id") {
    id: ID!
    name: String
    book: BooksBook
}

# This will use federation _entities(representations: $representations) query 
# using external type's key 
type BooksBook @external {
    id: ID!
    # optional back link. `fields` supports graphql syntax with aliases, can be use fields, leaf properties will be used as vars in  `representation`
    # e.g.  @inverse(fields: "title publisher {publisherId: id}", representation: "book: {title: $title, publisher_id: $publisherId}")
    # also supports custom queries via `query` prop
    # e.g.  @inverse(fields: "boookId: id", representation: "$boookId", query: "users(where: {book_id_in: $representations})")
    user: User @inverse(fields: "id", representation: "book: {id: $id}") 
}

# This will use federation _entities(representations: $representations) query 
# using explicity set key in `fields` (can be complex, such as "topic {id}, uses graphql selection syntax")
type BooksBook @external(fields: "id") {
    id: ID!
}

# This will use custom query from  related service and pass it's arguments to this service
# query has two predefined variables  that can be used: $representations and $typename
# $typename will be replaced with nrmalized type (`Book` in this example)
# in $representations will be injected result of querying `fields` from stored representations
# e.g. parent user `{"id": 1. "book": {"id": 1}}`, `fields: "id"` will query `book` and result in `{"id": 1}`
# optional `onlyKeys: true` will extract values from representation, and result in `1`
# field arguments will be smartly merged with relation constraint  
# LIMITATIONS:
# * query must be on top level
# * `$representations` will always be an array
type BooksBook @external(query: "Books(where: {id_in: $representations})", fields: "id", onlyKeys: true) {
    id: ID!
}

Push data to another service

Books pushes itself to users by adding book to a user from itself

type Book @key(fields: "id") {
   id: ID!
   title: String
   announce: String
}
extend type UsersUser @key(fields: "id") {
   id: ID! @external
   book: Book
}

dev tips

Homestead included. To run without php copy Homestead.yaml.example to Homestead.yaml and replace $PWD with current directory and change provider if needed`. In bash:

cp Homestead.yaml.example Homestead.yaml && sed -i '' "s|\$PWD|$PWD|g" Homestead.yaml