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

@apisyouwonthate/spectral-jsonapi

v2.1.0

Published

A Spectral ruleset for JSON:API, built as TypeScript.

Readme

Spectral JSON:API Ruleset

Node.js CI

Automatically check if OpenAPI descriptions are compliant with JSON:API v1.1 using this Spectral ruleset so API teams can catch problems early in editors, CI, and pull requests.

⚡️ Quick Start

npm install --save-dev spectral-jsonapi @stoplight/spectral-cli

Create a local ruleset file:

# .spectral.yaml
extends:
  - spectral:oas
  - "@apisyouwonthate/spectral-jsonapi"

Lint your OpenAPI description:

spectral lint api/openapi.yaml

🔨 Usage

Use as npm package

Use this when the project already installs dependencies with npm.

# .spectral.yaml
extends:
  - spectral:oas
  - "@apisyouwonthate/spectral-jsonapi"

Use legacy YAML directly from GitHub

Use this when you want to consume the generated YAML ruleset without installing the package:

extends:
  - "https://raw.githubusercontent.com/apisyouwonthate/spectral-jsonapi/refs/heads/main/.spectral.yml"

Once you have the ruleset set up, you can run Spectral in the same directory as your .spectral.yml ruleset, and it will include the JSON:API rules in its check

spectral lint api/openapi.yaml

This does not include spectral:oas rules, so to get these add it to the extend list:

extends:
  - "https://raw.githubusercontent.com/apisyouwonthate/spectral-jsonapi/refs/heads/main/.spectral.yml"
  - spectral:oas

Rule Opt-Outs

resource-object-id-required

Use this opt-out only when a response schema is intentionally not a standard JSON:API resource object (for example, ephemeral computed resources without stable IDs).

Set x-jsonapi-virtual-resource: true on the resource schema to skip the resource-object-id-required warning.

components:
  schemas:
    AvailableSlotResource:
      type: object
      x-jsonapi-virtual-resource: true
      required:
        - type
        - attributes
      properties:
        type:
          type: string
          enum:
            - availableSlot
        attributes:
          $ref: "#/components/schemas/AvailableSlotAttributes"

👥 Contributing

For testing approach and contributor workflow, see CONTRIBUTING.md.

🎉 Thanks

📜 License

MIT. See LICENSE.

🌳 Sponsor

If you'd like to say thanks for this style guide, consider supporting Protect Earth, a charity co-founded by APIs You Won't Hate's co-founder Phil Sturgeon, focused on nature-based climate solutions. Phil spends most of his time planting trees and re-wetting bogs now, especially at the Warleigh Nature Reserve, so this is a great way to support his work and the planet at the same time.