
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
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.
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 Online Version: DevKits - Docker Compose Generator
| Package | Description |
|---|---|
| @devkits/base64-tool | Base64 encoding/decoding |
| @devkits/env-editor | .env file utilities |
| @devkits/json-formatter | Format and validate JSON |
| @devkits/chmod-calculator | Unix file permissions |
Browse all 82 tools at DevKits
MIT
FAQs
Parse and generate docker-compose.yml files. Build compose configurations programmatically. Zero-dependency Docker Compose utility.
The npm package devkits-docker-compose-parser receives a total of 0 weekly downloads. As such, devkits-docker-compose-parser popularity was classified as not popular.
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.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.