# dockerode-options

> Parse docker options out of DOCKER_HOST or Docker in Docker setup

Latest version **0.2.1** (published 2015-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install dockerode-options
pnpm add dockerode-options
yarn add dockerode-options
bun add dockerode-options
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2015-12-09 |
| First published | 2014-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | James Lal [:lightsofapollo] |
| Maintainers | lights-of-apollo |
| Keywords | docker, dockerode, DOCKER_HOST |

## Links

- npm: https://www.npmjs.com/package/dockerode-options
- Repository: https://github.com/lightsofapollo/dockerode-options
- Homepage: https://github.com/lightsofapollo/dockerode-options#readme
- Issues: https://github.com/lightsofapollo/dockerode-options/issues
- npm.io page: https://npm.io/package/dockerode-options

## Recent versions

- 0.2.1 (latest) — 2015-12-09
- 0.2.0 — 2015-12-07
- 0.1.0 — 2014-01-23
- 0.0.0 — 2014-01-22

## README

dockerode-options
=================

Can both parse string based options (like 127.0.0.1:4243) for dockerode and find sensible defaults for connecting to docker.


## Usage


### With a string

```js
var dockerOpts = require('dockerode-options');
var Docker = require('dockerode');

// DOCKER_HOST = '127.0.0.1:4243'
var options = dockerOpts(process.env.DOCKER_HOST);
// => { host: 'http://127.0.0.1', port: 4243 }

// these can now be used to start dockerode
var docker = new Docker(options);
```


### With no options

```js
var dockerOpts = require('dockerode-options');
var options = dockerOpts();
// => { socketPath: '/var/run/docker.sock' }
```

### With DOCKER_HOST environment variable set

```js
var dockerOpts = require('dockerode-options');

process.env.DOCKER_HOST = '127.0.0.1:60022';

var options = dockerOpts();
// => { host: '127.0.0.1', port: 60022  };
```

### With DOCKER_CERT_PATH environment variable set

```js
var dockerOpts = require('dockerode-options');

process.env.DOCKER_CERT_PATH = '/home/certs';

var options = dockerOpts();
// => { ca: <contents of /home/certs/ca.pem>, cert: <contents of /home/certs/cert.pem>, key: <contents of /home/certs/key.pem>  };
```

---
_Source: https://npm.io/package/dockerode-options · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
