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

nest-stoplight

v1.0.4

Published

Bring Stoplight Elements using Swagger OpenAPI docs to NestJS!

Readme

Nest OpenAPI Stoplight Elements Module

already had some @nestjs/swagger generated mindblowing large API documentation, and want to use Stoplight Elements to display it? This module is for you.

Because SwaggerUI lacks a user-friendly navigation for large API documentations, Stoplight might be a great alternative for this use case.

That's why I implemented a NestJS module that allows you to use Stoplight Elements with your existing OpenAPI documentations.

How does it work?

This module uses handlebars to render a custom HTML template that loads the Stoplight Elements JS+CSS and places the respective WebComponent provided by Stoplight.

You load the module after you created the Swagger OpenAPI document in your main.ts from nest. This way you can pass the OpenAPI document object to the Stoplight Elements module.

For serving the OpenAPI yaml and json files, we internally use the @nestjs/swagger module with SwaggerUI disabled:

SwaggerModule.setup(path, app, document, {
  swaggerUiEnabled: false
});

This deploys the OpenAPI document at /<your-path>-json and /<your-path>-yaml. <your-path> is the path you provide to the module config and where your Stoplight Elements UI can be found

Getting Started

To get started, install the module:

npm install nest-swagger-spotlight

Then load the module accompanied by the swagger document part in your main.ts or wherever you bootstrap your NestJS app:

const options = new DocumentBuilder()
.setTitle('Example REST API')
.setDescription('Stoplight Elements Test API ')
.build();

const doc = SwaggerModule.createDocument(app, options);

await StoplightElementsModule.setup('/docs', app, doc);

You can also pass additional options to the setup method, such as a custom logo:

await StoplightElementsModule.setup('/docs', app, doc, {
  logo: 'https://example.com/logo.png',
});

Usable properties are:

export interface StoplightElementsOptions {
  apiDescriptionDocument?: string;
  apiDescriptionUrl?: string;
  basePath?: string;
  hideInternal?: boolean;
  hideTryIt?: boolean;
  hideSchemas?: boolean;
  hideExport?: boolean;
  tryItCorsProxy?: string;
  tryItCredentialPolicy?: string;
  layout?: 'sidebar' | 'stacked' | 'responsive';
  logo?: string;
  router?: 'hash' | 'memory';
}

Contributions

If you have any ideas on how to optimize this module, feel free to open an issue or a pull request.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgements

This module is inspired by this non-express package, but my package is not a fork - it's a completely new project just with inspired and partially copied code => LICENSE ack to @nawbc.