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

devkits-docker-compose-parser

v1.0.7

Published

Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.

Readme

@devkits/docker-compose-parser

Part of DevKits

Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.

💰 Support DevKits

Love these tools? Support development via Open Collective

  • $5/mo - Supporter (priority support)
  • $9/mo - Pro (early access to new tools)
  • $29 - Lifetime (all current + future Pro features)

💎 Upgrade to DevKits Pro

Get access to 20+ premium tools including SQL to Code, Data Faker, JWT Generator, and more — all for $9 one-time.

→ Unlock DevKits Pro

💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted. View crypto addresses

🧰 DevKits Pro Tools

This package is part of DevKits — 82+ free developer tools. The online Docker Compose Generator includes 20+ templates (Node+Mongo, Python+Postgres, etc.).

Browse Docker Templates

Installation

npm install @devkits/docker-compose-parser

Usage

const { parse, generate, getServices, validate, createService, TEMPLATES } = require('@devkits/docker-compose-parser');

// Parse docker-compose.yml
const yaml = `
version: "3.8"
services:
  web:
    image: nginx
    ports:
      - "80:80"
    volumes:
      - ./html:/usr/share/nginx/html
  db:
    image: postgres:16
    environment:
      - POSTGRES_PASSWORD=secret
`;

const config = parse(yaml);
// { version: '3.8', services: { web: {...}, db: {...} } }

// Get service names
getServices(config);
// ['web', 'db']

// Validate configuration
validate(config);
// { valid: true, errors: [] }

// Generate docker-compose.yml from object
const newConfig = {
  version: '3.8',
  services: {
    app: createService({
      image: 'node:20-alpine',
      build: '.',
      ports: ['3000:3000'],
      environment: ['NODE_ENV=production'],
      volumes: ['.:/app']
    })
  }
};

const yamlOut = generate(newConfig);
// version: "3.8"
// services:
//   app:
//     image: node:20-alpine
//     build: .
//     ...

// Use built-in templates
const template = TEMPLATES['node-mongo'];
const templateYaml = generate(template);

API

parse(yaml)

Parses a docker-compose YAML string into a JavaScript object.

generate(config)

Generates docker-compose.yml string from a config object.

getServices(config)

Returns array of service names from a parsed config.

validate(config)

Validates a docker-compose config, returns {valid, errors}.

createService(options)

Helper to create a service configuration object.

TEMPLATES

Built-in templates for common stacks (node-mongo, python-postgres, etc.).

Supported Properties

| Property | Description | |----------|-------------| | image | Docker image to use | | build | Build context path | | ports | Port mappings (host:container) | | environment | Environment variables | | volumes | Volume mounts | | depends_on | Service dependencies | | restart | Restart policy |

See Also

🔧 More DevKits Tools

Free Tools (82+): | Tool | Description | |------|-------------| | base64-tool | Base64 encode/decode | | chmod-calculator | Unix permissions converter | | cron-parser | Cron expression parser | | csv-json-converter | CSV ↔ JSON converter | | diff-checker | Text comparison (LCS) |

Browse All 82+ Free Tools

💎 DevKits Pro — $9 One-Time

Unlock 20+ premium tools with a single payment:

→ Unlock DevKits Pro for $9

💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted

🚀 Other Products from Us

| Product | Description | |---------|-------------| | Invoicely | Free invoice generator for freelancers | | SnapOG | Free OG image generator (20+ templates) |

License

MIT