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

@bluejeans/flexdoc-backend

v1.0.3

Published

FlexDoc backend integration for NestJS and other frameworks

Readme

FlexDoc Backend

npm version License: MIT

The backend package for FlexDoc, a modern, customizable OpenAPI documentation generator that creates beautiful API documentation.

Screenshots

Light Mode

FlexDoc Light Mode

Dark Mode

FlexDoc Dark Mode

Features

  • Modern UI: Clean, responsive interface with dark mode support
  • Customizable: Easily customize colors, typography, and layout
  • Interactive: Test API endpoints directly from the documentation
  • Framework Agnostic: Works with any JavaScript framework
  • OpenAPI Compatible: Supports OpenAPI 3.0 specifications

Installation

npm install @bluejeans/flexdoc-backend

Usage

Basic Usage

import { FlexDoc } from '@bluejeans/flexdoc-backend';
import { OpenAPIObject } from '@nestjs/swagger';

// Create a new FlexDoc instance with your OpenAPI spec
const flexdoc = new FlexDoc({
  spec: yourOpenAPISpec as OpenAPIObject,
  title: 'My API Documentation',
  description: 'Documentation for my awesome API',
});

// Generate HTML documentation
const html = flexdoc.generateHTML();

// Serve the documentation
app.get('/api/docs', (req, res) => {
  res.send(html);
});

Configuration Options

FlexDoc is highly customizable through the FlexDocOptions interface:

import { FlexDoc, FlexDocOptions } from '@bluejeans/flexdoc-backend';

const options: FlexDocOptions = {
  // Required
  spec: yourOpenAPISpec,

  // Basic metadata
  title: 'My API Documentation',
  description: 'Documentation for my awesome API',

  // Theme configuration
  themeConfig: {
    colors: {
      primary: {
        main: '#3b82f6',
        light: '#eff6ff',
        dark: '#2563eb',
      },
      // Additional color options...
    },
    typography: {
      fontFamily: 'Inter, system-ui, sans-serif',
      fontSize: '16px',
      // Additional typography options...
    },
  },

  // Footer customization
  footer: {
    copyright: '© 2025 My Company',
    links: [
      {
        text: 'Terms',
        url: '/terms',
        icon: 'file-text', // Optional Lucide icon name
      },
      {
        text: 'Privacy',
        url: '/privacy',
      },
    ],
  },

  // Additional options...
};

const flexdoc = new FlexDoc(options);

Framework Integration Examples

NestJS

import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { FlexDoc } from '@bluejeans/flexdoc-backend';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // Create OpenAPI spec with Swagger
  const config = new DocumentBuilder()
    .setTitle('My API')
    .setDescription('My API description')
    .setVersion('1.0')
    .build();
  const document = SwaggerModule.createDocument(app, config);

  // Create FlexDoc instance
  const flexdoc = new FlexDoc({
    spec: document,
    title: 'My API Documentation',
    description: 'Documentation for my awesome API',
    footer: {
      copyright: '© 2025 My Company',
    },
  });

  // Serve FlexDoc at /api/docs
  app.use('/api/docs', (req, res) => {
    res.send(flexdoc.generateHTML());
  });

  await app.listen(3000);
}
bootstrap();

Express

import express from 'express';
import { FlexDoc } from '@bluejeans/flexdoc-backend';
import swaggerJsdoc from 'swagger-jsdoc';

const app = express();

// Generate OpenAPI spec
const options = {
  definition: {
    openapi: '3.0.0',
    info: {
      title: 'My API',
      version: '1.0.0',
    },
  },
  apis: ['./src/routes/*.js'],
};
const openapiSpec = swaggerJsdoc(options);

// Create FlexDoc instance
const flexdoc = new FlexDoc({
  spec: openapiSpec,
  title: 'My API Documentation',
});

// Serve FlexDoc
app.get('/api/docs', (req, res) => {
  res.send(flexdoc.generateHTML());
});

app.listen(3000);

API Reference

FlexDoc Class

The main class for generating API documentation.

Constructor

constructor(options: FlexDocOptions)

Methods

  • generateHTML(): Generates the HTML documentation
  • getOpenAPISpec(): Returns the processed OpenAPI specification

FlexDocOptions Interface

Configuration options for FlexDoc:

| Property | Type | Description | | -------------- | ------------------------------- | -------------------------------- | | spec | OpenAPIObject | The OpenAPI specification object | | title | string | Documentation title | | description | string | Documentation description | | themeConfig | ThemeConfig | Theme configuration | | footer | FooterConfig | Footer configuration | | favicon | string | URL to favicon | | customCss | string | Custom CSS to inject | | customJs | string | Custom JavaScript to inject | | defaultTheme | 'light' \| 'dark' \| 'system' | Default theme mode |

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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