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

@glowing-fishstick/api

v0.1.4

Published

Core API factory and route composition module for glowing-fishstick

Readme

@glowing-fishstick/api

Express 5 API factory for the glowing-fishstick framework. Composes a JSON-only Express application with lifecycle hooks, request logging, and a plugin architecture — no view engine or static file serving.

Install

npm install @glowing-fishstick/api

Usage

import { createApi, createApiConfig } from '@glowing-fishstick/api';

const config = createApiConfig({ port: 3001 });

const myPlugin = (app, cfg) => {
  app.get('/hello', (_req, res) => res.json({ message: 'hello' }));
};

const app = createApi(config, [myPlugin]);

app.listen(config.port, () => {
  console.log(`API listening on port ${config.port}`);
});

createApiConfig(overrides?, env?)

Returns a frozen config object. Key properties:

| Property | Type | Default | Description | |---|---|---|---| | port | number | 3001 | HTTP listen port | | nodeEnv | string | 'development' | Runtime environment | | appName | string | 'api' | Application name | | services | ServiceContainer | auto-created | Dependency injection container (see below) | | enableRequestLogging | boolean | true | Enable Pino HTTP request logging | | blockBrowserOrigin | boolean | false | Reject requests with browser Origin header | | requireJwt | boolean | false | Require JWT bearer tokens on all routes | | jwtSecret | string | '' | JWT signing/verification secret | | jwtExpiresIn | string | '120s' | Token TTL | | jsonBodyLimit | string | '100kb' | Max JSON body size | | shutdownTimeout | number | 30000 | Graceful shutdown timeout (ms) | | adminRateLimitWindowMs | number | 60000 | Rate-limit window (ms) | | adminRateLimitMax | number | 60 | Max requests per window |

config.services — ServiceContainer

createApiConfig() automatically creates a ServiceContainer (from @glowing-fishstick/shared) and attaches it as config.services. Use this container for dependency injection instead of creating your own or using module-level singletons.

import { createApiConfig } from '@glowing-fishstick/api';

const config = createApiConfig({ port: 3001 });

// Register a service (e.g., database pool, external client)
config.services.register('vault', async (ctx) => {
  const client = await connectToVault();
  return client;
}, { dispose: (client) => client.close() });

// Resolve in a plugin or route handler
const myPlugin = (app, cfg) => {
  app.get('/secrets', async (req, res) => {
    const vault = await cfg.services.resolve('vault');
    res.json(await vault.getCredentials());
  });
};

ServiceContainer methods: register(name, provider, opts?), registerValue(name, value, opts?), resolve(name), has(name), keys(), dispose().

You can also pass your own container via createApiConfig({ services: myContainer }).

Exports

| Export | Description | |---|---| | createApi | Factory that composes Express app with middleware, plugins, and routes | | createApiConfig | Configuration factory with env-var layering and ServiceContainer |

License

MIT