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

@infodb/tfme

v0.2.0

Published

Terraform schema to YAML conversion and documentation download

Readme

tfme

Terraform provider schema converter and documentation downloader.

Features

  • YAML Export: Export specific Terraform resource schema to YAML format (simple conversion, no transformations)
  • Markdown Download: Download specific resource documentation from Terraform Registry API
  • Auto Provider Detection: Automatically detect provider name from resource name (e.g., aws_vpcaws)
  • GitHub Integration: Automatically download provider schemas from GitHub repository
  • Local Cache: Cache downloaded schemas in ~/.tfme/cache/ for faster access

Installation

# Install globally
npm install -g @infodb/tfme

# Or use with pnpx
pnpx @infodb/tfme

# Or install locally and build
cd tfme
pnpm install
pnpm run build

Quick Start

Export Resource Schema to YAML

# Export resource schema (provider auto-detected from resource name)
pnpx @infodb/tfme export -r aws_vpc -o output

# Clear cache and download fresh schema
pnpx @infodb/tfme export -r aws_vpc --clear-cache -o output

Download Resource Documentation

# Download resource documentation (provider auto-detected)
pnpx @infodb/tfme download -r aws_vpc -o docs

# With specific version
pnpx @infodb/tfme download -r aws_vpc -v 5.0.0 -o docs

Command Reference

export Command

Export Terraform resource schema to YAML format.

tfme export [options]

Options:

  • -r, --resource <resource> (required): Resource name (e.g., aws_vpc)
  • -o, --output <dir>: Output directory (default: "output")
  • --clear-cache: Clear cache before downloading

Examples:

# Export resource schema (provider auto-detected)
pnpx @infodb/tfme export -r aws_vpc -o output

# Export with cache clearing
pnpx @infodb/tfme export -r azurerm_virtual_network --clear-cache -o output

download Command

Download Markdown documentation from Terraform Registry.

tfme download [options]

Options:

  • -r, --resource <resource> (required): Resource name (e.g., aws_vpc)
  • -o, --output <dir>: Output directory (default: "docs")
  • -n, --namespace <namespace>: Provider namespace (default: hashicorp)
  • -v, --version <version>: Provider version (default: latest)

Examples:

# Download resource documentation (provider auto-detected)
pnpx @infodb/tfme download -r aws_vpc -o docs

# Download with specific version
pnpx @infodb/tfme download -r aws_s3_bucket -v 5.0.0 -o docs

# Download with custom namespace
pnpx @infodb/tfme download -r aws_vpc -n hashicorp -o docs

Schema Generation (for Repository Maintainers)

Provider schemas are stored in this repository under schemas/providers/. To generate new schemas:

cd schemas/scripts
./generate-schemas.sh

This script:

  1. Initializes Terraform for each provider (aws, azurerm, google)
  2. Generates schema JSON for each provider
  3. Saves to schemas/providers/{provider}.json

Output Format

YAML Export

The export command extracts the specified resource schema and converts it to YAML format:

version: 1
block:
  attributes:
    arn:
      type: string
      description_kind: plain
      computed: true
    cidr_block:
      type: string
      description_kind: plain
      optional: true
      computed: true
    enable_dns_support:
      type: bool
      description_kind: plain
      optional: true

Markdown Documentation

Downloaded documentation is in standard Terraform documentation format:

---
subcategory: "VPC (Virtual Private Cloud)"
layout: "aws"
page_title: "AWS: aws_vpc"
---

# Resource: aws_vpc

Provides a VPC resource.

## Example Usage
...

Cache Directory

Downloaded schemas are cached in ~/.tfme/cache/ to improve performance:

~/.tfme/
└── cache/
    ├── aws.json
    ├── azurerm.json
    └── google.json

Clear cache with --clear-cache flag or manually delete files.

Development

# Install dependencies
pnpm install

# Build
pnpm run build

# Watch mode
pnpm run dev

# Run CLI
pnpm run start export -r aws_vpc -o output
pnpm run start download -r aws_vpc -o docs

Project Structure

tfme/
├── bin/cli.js              # CLI entry point
├── src/
│   ├── index.ts            # Main CLI setup
│   ├── commands/
│   │   ├── export.ts       # Export command
│   │   └── download.ts     # Download command
│   └── utils/
│       ├── converter.ts    # JSON to YAML converter
│       ├── schema-fetcher.ts # GitHub schema fetcher with cache
│       └── registry-client.ts # Terraform Registry API client
└── schemas/
    ├── terraform/          # Terraform configurations per provider
    │   ├── aws/
    │   ├── azurerm/
    │   └── google/
    ├── providers/          # Generated schema JSON files
    └── scripts/
        └── generate-schemas.sh

License

MIT