
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
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.
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 2 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.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.