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

@mintlify/msft-sdk

v1.1.72

Published

Lightweight SDK for Microsoft documentation with MDX rendering

Readme

@mintlify/msft-sdk

Lightweight SDK for rendering Microsoft-style documentation with MDX support.

Installation

npm install @mintlify/msft-sdk

Quick Start

1. Import Styles

import "@mintlify/msft-sdk/styles.css";

Optional: Add dark mode support with Tailwind CSS:

@variant dark (&:where(.dark, .dark *));

2. Convert HTML to MDX

import { convertHtmlToMdx, serializeMdx } from "@mintlify/msft-sdk";

const { mdx, mdxExtracts } = await convertHtmlToMdx(htmlContent, {
  metadata: { title: "My Doc" },
});

const Content = await serializeMdx(mdx);

3. Render Documentation

import { DocsPage } from "@mintlify/msft-sdk";

<DocsPage
  payload={{
    serializedContent: Content,
    title: "Documentation",
    mdxExtracts,
  }}
  toc={tocItems}
  navTree={navTree}
/>;

Core Exports

Documentation Components

  • DocsPage - Main documentation page component
  • ApiPage - API reference page component
  • DocsLayout - Layout with navigation sidebar
  • MDXRenderer - Standalone MDX renderer
  • NavTree, TableOfContents - Navigation components
  • allComponents - All available MDX components

Content Processing

  • convertHtmlToMdx - Convert HTML to MDX
  • serializeMdx - Compile MDX to React components

OpenAPI Utilities

  • convertOpenApiSpecToGraph - Convert OpenAPI spec to schema graph data
  • convertOpenApiSpecToNav - Generate navigation structure from OpenAPI spec
  • convertOpenApiSpecToHrefMap - Create href-to-endpoint lookup map

OpenAPI Integration

The SDK provides utilities for working with OpenAPI specifications:

import {
  convertOpenApiSpecToGraph,
  convertOpenApiSpecToNav,
  convertOpenApiSpecToHrefMap,
  getApiReferenceDataFromGraph,
  ApiPage,
} from "@mintlify/msft-sdk";
import openApiSpec from "./my-openapi-spec.json";

// Convert spec to schema graph (required for API rendering)
const graphData = convertOpenApiSpecToGraph(openApiSpec, {
  filename: "my-api.json",
  originalFileLocation: "my-api.json",
});

// Generate navigation from OpenAPI spec
const navData = convertOpenApiSpecToNav(openApiSpec);

// Create href-to-endpoint map for routing
const hrefMap = convertOpenApiSpecToHrefMap(openApiSpec);

// Get API reference data for a specific endpoint
const apiReferenceData = getApiReferenceDataFromGraph({
  metadata: {
    title: "Create User",
    description: "Create a new user",
    openapi: "post /users",
  },
  schemaGraphData: graphData,
});

// Render the API page
<ApiPage
  apiReferenceData={apiReferenceData}
  pageMetadata={metadata}
  theme="light"
/>;

Development

Running Tests

This project uses Vitest for testing.

# Run tests once
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Test Structure

Tests are located in the tests/ directory and are organized as follows:

  • tests/fixtures/ - Test fixtures including OpenAPI specs and expected outputs
  • tests/*.test.ts - Test files for various conversion functions

The test fixtures are kept outside of the src/ directory to ensure they're not bundled with the package.

License

MIT © Mintlify, Inc.