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

@molion/docker-compose-v3-8

v1.0.0

Published

TypeScript definitions for Docker Compose v3.8 with comprehensive documentation for LSP hover support. Compatible with Docker Swarm stack deploy.

Downloads

17

Readme

Docker Compose v3.8 TypeScript Types

TypeScript definitions for Docker Compose v3.8 with comprehensive documentation for LSP hover support. Compatible with Docker Swarm docker stack deploy.

Almost all of this was generated with Claude Sonnet 4. I just wanted the types.

Features

  • Complete TypeScript definitions for Docker Compose v3.8 format
  • Rich JSDoc comments for LSP hover documentation
  • Docker Swarm compatible - works with docker stack deploy
  • IDE support - IntelliSense, auto-completion, and validation
  • Generated from official schema - always up-to-date with Docker CLI

Installation

npm install @molion/docker-compose-v3-8
# or
yarn add @molion/docker-compose-v3-8
# or  
pnpm add @molion/docker-compose-v3-8

Usage

Basic Usage

import { DockerComposeV38 } from '@your-username/docker-compose-v3-8';

const composeFile: DockerComposeV38 = {
  version: '3.8',
  services: {
    web: {
      image: 'nginx:alpine',
      ports: ['80:80'],
      deploy: {
        replicas: 3,
        placement: {
          constraints: ['node.role == worker']
        },
        resources: {
          limits: {
            cpus: '0.5',
            memory: '512M'
          }
        }
      }
    },
    db: {
      image: 'postgres:13',
      environment: {
        POSTGRES_PASSWORD: 'secret'
      },
      volumes: ['db-data:/var/lib/postgresql/data'],
      deploy: {
        placement: {
          constraints: ['node.role == manager']
        }
      }
    }
  },
  volumes: {
    'db-data': {
      driver: 'local'
    }
  }
};

IDE Support

When you hover over properties in your IDE, you'll see helpful documentation:

  • deploy: "Deployment configuration for Swarm mode. Only works with docker stack deploy, ignored by docker-compose up."
  • replicas: "Number of service replicas to run in the swarm."
  • placement.constraints: "Node placement constraints. Example: ['node.role == manager', 'node.labels.zone == east']"

Docker Swarm Compatibility

This package is specifically designed for Docker Compose v3.8, which is compatible with Docker Swarm's docker stack deploy command:

# Your compose file will work with:
docker stack deploy -c docker-compose.yml mystack

# Properties like 'deploy', 'secrets', 'configs' are Swarm-specific
# and only take effect when deploying via docker stack deploy

Available Types

The package exports the following main types:

  • DockerComposeV38 - Root compose file interface
  • Service - Service definition
  • Deploy - Swarm deployment configuration
  • Network - Network definition
  • Volume - Volume definition
  • Secret - Secret definition (Swarm only)
  • Config - Config definition (Swarm only)
  • And many more specific types...

Development

This package is generated from the official Docker CLI v3.8 schema with enhanced documentation.

To regenerate the types:

git clone https://github.com/m0lion/docker-compose-v3-8
cd docker-compose-v3-8
pnpm install
pnpm run build

Why This Package?

The official Docker Compose v3.8 JSON schema lacks description fields, making standard type generation tools produce types without documentation. This package solves that by:

  1. Downloading the official v3.8 schema from Docker CLI
  2. Enhancing it with comprehensive documentation
  3. Generating TypeScript types with JSDoc comments
  4. Providing rich IDE hover information

License

Unlicense

Contributing

The types shouldn't change, so there should be no reason to update this, so I am not planning on maintaining it. Feel free to fork it.