@evilkiwi/compose
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@evilkiwi/compose provides TypeScript bindings to Docker Compose commands and syntax.

  • Supports both Compose v1 & v2
  • Functional API
  • Side-effect free
  • Zero dependencies
  • ES Module
  • Less than 3kb

Installation

This package is available via NPM:

yarn add @evilkiwi/compose

# or

npm install @evilkiwi/compose

Usage

import { compose } from '@evilkiwi/compose';

// By default, the current cwd will be used.
await compose().up();

// You can specify a different cwd, too.
await compose({ cwd: '/path/to/project' }).up();

// As well as cwd, the files used for docker compose can be specified.
await compose({
  cwd: '/path/to/project',
  path: ['my-compose-file.yaml'],
}).up();

// Or you can alternatively specify your compose config inline as a string.
await compose({
  cwd: '/path/to/project',
  config: `
name: my-project

services:
  proxy:
    container_name: proxy
    image: nginx:latest
    restart: always`,
}).up();

// `@evilkiwi/compose` uses Docker Compose v2 by default, you can force it to use v1.
await compose({
  cwd: '/path/to/project',
  v1: true,
}).up();

Package Sidebar

Install

npm i @evilkiwi/compose

Weekly Downloads

0

Version

1.1.0

License

GPL-3.0-only

Unpacked Size

42.7 kB

Total Files

8

Last publish

Collaborators

  • oyed