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

@dwp/casa-massimo-plugin

v0.1.3

Published

A CASA plugin wrapper for the Massimo API library generator

Readme

casa-massimo

A CASA plugin wrapper for the Massimo API library generator.

Installation

npm install @dwp/casa-massimo-plugin

Usage

Create a CASA plugin by passing in Massimo buildOpenAPIClient() options:

import { join } from "node:path";
import { configure } from "@dwp/govuk-casa";
import casaMassimo from "@dwp/casa-massimo-plugin";

// Build a plugin for our movies API
const moviesClientPlugin = await casaMassimo({
  // Property name for request object
  name: "movies",
  // Path to Open API spec
  path: join(import.meta.dirname, "./schemas/movies.openapi.json"),
  // The base URL of the API, method paths in the spec will be appended to this
  url: process.env.MOVIES_API_URL,
  // Throw an error on 400 and 500 level status codes
  throwOnError: true,
  // Return full response ({ headers, body, statusCode }) if `true`, otherwise
  // the client will just return the response body.
  fullResponse: true,
  // If `true` require full request options including param type, rather than
  // flat object: `req.movies.getMovieById({ path: { id: 100 } })` vs
  // `req.movies.getMovieById({ id: 100 })`. May be required if you have
  // duplicate key names across path params, query, headers and/or body.
  fullRequest: false,
  // Validate the HTTP response against the Open API schema and throw on error.
  validateResponse: false,
  // Function to add headers to the HTTP request
  getHeaders(req, res, opts) {
    // Send inbound correlation on all outbound HTTP requests from the client
    return { "x-correlation-id": req.get("x-correlation-id") };
  },
});

// Load it into our CASA app
const casa = configure({
  ...
  plugins: [moviesClientPlugin],
});

This will build a client from the "movies" OpenAPI JSON spec and bind it to the express request:

export default () => [
  {
    waypoint: "my-page",
    view: "pages/my-page",
    hooks: [
      {
        hook: "prerender",
        async middleware(req, res, next) {
          const { body } = await req.movies.getMovieById({ id: req.params.id });
          res.locals.movie = body;
          next();
        },
      },
    ],
  },
];

The Massimo buildOpenAPIClient function is also available as a named export:

import { buildOpenAPIClient } from "@dwp/casa-massimo-plugin";

const client = await buildOpenAPIClient({
  name: "movies",
  path: join(import.meta.dirname, "./schemas/movies.openapi.json"),
  url: process.env.MOVIES_API_URL,
  throwOnError: true,
  fullResponse: false,
  fullRequest: false,
  validateResponse: false,
});

const movie = await client.getMovieById({ id: 100 });

For more information see the Massimo documentation.