
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
devkits-docker-compose-parser
Advanced tools
Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.
Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.
Love these tools? Support development via Open Collective
Get access to 20+ premium tools including SQL to Code, Data Faker, JWT Generator, and more — all for $9 one-time.
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted. View crypto addresses
This package is part of DevKits — 82+ free developer tools. The online Docker Compose Generator includes 20+ templates (Node+Mongo, Python+Postgres, etc.).
npm install @devkits/docker-compose-parser
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);
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.
TEMPLATESBuilt-in templates for common stacks (node-mongo, python-postgres, etc.).
| 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 |
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) |
Unlock 20+ premium tools with a single payment:
💡 Pay with Crypto: BTC, ETH, USDT (TRC-20), SOL accepted
| Product | Description |
|---|---|
| Invoicely | Free invoice generator for freelancers |
| SnapOG | Free OG image generator (20+ templates) |
MIT
FAQs
Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.
We found that devkits-docker-compose-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.