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 🙏

© 2024 – Pkg Stats / Ryan Hefner

print-openapi

v0.0.5

Published

Generate a printable HTML file from your OpenAPI spec.

Downloads

7

Readme

Print OpenAPI NPM Package MIT License Tests

This tool takes an OpenAPI file and spits out a printable, static HTML file. Since most browsers have a 'Print to PDF' function, you can use this to generate nice PDFs of your OpenAPI specs.

Why?

Most OpenAPI tooling focuses on creating fancy displays that you can click on, send API requests with, etc. But sometimes you just need a plain, easily-readable, and static copy of your API docs. We needed that here at Sendle for our internal documentation, so we built this tool!

How?

The tool uses the OpenAPI tooling released by ReadMe. Go check them out if you're after a nice developer hub – their offering is pretty cool!

Installation

$ npm install -g print-openapi

Usage

$ print-openapi export-html bbs-openapi.yaml bbs-openapi.html

Generate a printable HTML file from the bbs-openapi.yaml OpenAPI file, including all paths and pages.


$ print-openapi export-html --tag moderation bbs-openapi.yaml bbs-moderation-openapi.html

Generate a printable HTML file from the bbs-openapi.yaml OpenAPI file, only including paths and pages that have the moderation tag.


$ print-openapi deref --tag system-messages --tag sysmsgv2 bbs-openapi.yaml ../sysmsg.openapi.json

Create a new OpenAPI file called sysmsg.openapi.json. This file only contains the paths and pages from bbs-openapi.yaml with either the system-messages or sysmsgv2 tags.

Markdown pages

We've defined the x-pages extension, which lets you define arbitrary markdown pages to be displayed on the exported HTML files. See the bottom of that extension page for our future plans with it!

Tags

--tag and -t refer to the tags that can be assigned to OpenAPI operations, and to our custom markdown pages as defined our x-pages extension.

When using print-openapi, by default all pages and operations are exported. However, when tags are specified the tool will only include pages and operations with those tags. See the example specs in /examples/.

License

Released under the MIT license. See LICENSE for details.