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

@spa-kit/node

v0.0.2

Published

Node-side (build/server) helpers for SPA projects

Readme

@spa-kit/node

Node-side (build- and server-time) helpers for SPA projects. Not for the browser — these modules use Node built-ins like fs.

Install

npm install -D @spa-kit/node graphql

graphql (v16) is a peer dependency.

getGraphqlSchema(schemaDirectory)

Recursively combines every *.graphql file under schemaDirectory into one printed schema (SDL). Tools like DGS let you split a schema across many files; Relay's compiler expects a single schema, so this glues them back together.

import { fileURLToPath } from "node:url";
import { getGraphqlSchema } from "@spa-kit/node";

const schemaDir = fileURLToPath(new URL("./src/main/resources/schema", import.meta.url));
const sdl = getGraphqlSchema(schemaDir);

Typical use is a small script that writes the combined SDL to a file your relay.config.js points at as its schema.

compileRelay(options)

Combines your split schema, runs the Relay compiler against it, then removes the transient schema file. Throws if compilation fails, so a broken schema fails your build (and CI) loudly.

import { compileRelay } from "@spa-kit/node";

compileRelay({
  schemaDirectory: "src/main/resources/schema",
  schemaOutputFile: "src/main/resources/relay/schema.graphql", // matches relay.config `schema`
});

| Option | Default | Description | | --- | --- | --- | | schemaDirectory | — | Directory of split *.graphql files to combine. | | schemaOutputFile | — | Where the combined schema is written; must match your relay.config schema. | | command | "relay-compiler" | Compiler command. Bare, it reads your relay.config; override for e.g. relay-compiler --validate. | | cleanup | true | Delete the written schema file afterward (on success or failure). |

relay-compiler must be installed and runnable on PATH — typically by calling this from an npm script.

CLI

The same thing is exposed as a spa-kit-compile-relay command, handy in an npm script:

{
  "scripts": {
    "relay": "spa-kit-compile-relay --schema-dir src/main/resources/schema --out src/main/resources/relay/schema.graphql"
  }
}

| Flag | Maps to | | | --- | --- | --- | | --schema-dir <dir> | schemaDirectory | required | | --out <file> | schemaOutputFile | required | | --command <cmd> | command | optional | | --no-cleanup | cleanup: false | optional |