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

docker-compose-tool

v0.0.1

Published

Utility for managing docker-compose from nodejs

Downloads

10

Readme

docker-compose-tool for nodejs

Note: This is still a very early stage project

This is a simple library for controlling docker-compose from node. The goal is to eventually provide access to all the commands of docker-compose from within NodeJS.

This repo is based off the excellent node-flowtype-boilerplate.

Why

Controlling docker-compose from node allows for multi-container integration tests and automation of command line tasks from node.

Getting States

Quick Example

import { DockerCompose } from 'docker-compose'
// let DockerCompose = require('docker-compose').DockerCompose

let compose = new DockerCompose({
  composePath: './docker-compose.yml'
})

compose.up('hello_world_service').then(() => {
  compose.logs('hello_world_service', (message) => {
    console.log(`received ${message} from container stdout`)
  })
})

new DockerCompose(options)

Create a new DockerCompose instance. Each DockerCompose instance has a set of options associated with it that link it to a docker compose file or default options for output, container creation, etc.

type ServiceOptions = {
  // _required_ Path to the compose yaml file
  composePath: string,
  // _optional_ default is true. recreate containers "docker-compose up --force-recreate ..."
  forceRecreate: bool,
  // _optional_ default is false. Place timestamps in log output. "docker-compose logs -t ..."
  timeStamps: bool,
  // _optional_ directory to execute docker-compose in, default is the directory with the compose yaml file
  workingDirectory: string
}

compose.up(services: ?string|Array, options: ?ServiceOptions): Promise

Start one or more services. Equivalent to docker-compose up [services].

Promise resolves when up is complete, which is not necessarily when the container finishes (the -d flag is used by default, running up as a daemon. Use compose.logs to watch for the exit.

compose.down(services: ?string|Array, options: ?ServiceOptions): Promise

Down one or more services. Equivalent to docker-compose down [services].

Promise resolves when down is complete.

compose.kill(services: ?string|Array, options: ?ServiceOptions): Promise

Kill one or more services. Equivalent to docker-compose kill [services].

Promise resolves when kill is complete.

compose.logs(services: ?string|Array, onMessage:Function, options: ?ServiceOptions): Promise

Watch the logs on one or more services. Equivalent to docker-compose logs [services].

Promise resolves after spawning command (basically instantly).

onMessage will receive a string line from docker-compose logs. Each line will be returned individually.

Contributing

Contributions via pull requests are welcome. If you find a problem please file an issue.

Running Tests

Just run npm test or yarn test.