# dat-manager

> Manage multiple dat instances on a single machine.

Latest version **2.0.1** (published 2016-03-29) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install dat-manager
pnpm add dat-manager
yarn add dat-manager
bun add dat-manager
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2016-03-29 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Karissa McKelvey |
| Maintainers | karissa |

## Links

- npm: https://www.npmjs.com/package/dat-manager
- Repository: https://github.com/karissa/dat-manager
- Homepage: https://github.com/karissa/dat-manager#readme
- Issues: https://github.com/karissa/dat-manager/issues
- npm.io page: https://npm.io/package/dat-manager

## Dependencies (17)

- [pump](https://npm.io/package/pump.md) ^1.0.1
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [level](https://npm.io/package/level.md) ^1.3.0
- [extend](https://npm.io/package/extend.md) ^3.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [cli-prompt](https://npm.io/package/cli-prompt.md) ^0.5.0
- [hyperdrive](https://npm.io/package/hyperdrive.md) ^3.5.1
- [os-homedir](https://npm.io/package/os-homedir.md) ^1.0.1
- [auto-daemon](https://npm.io/package/auto-daemon.md) ^2.6.0
- [level-party](https://npm.io/package/level-party.md) ^3.0.4
- [stream-each](https://npm.io/package/stream-each.md) ^1.1.2
- [run-parallel](https://npm.io/package/run-parallel.md) ^1.1.4
- [folder-walker](https://npm.io/package/folder-walker.md) ^2.1.1
- [relative-date](https://npm.io/package/relative-date.md) ^1.1.2
- [collect-stream](https://npm.io/package/collect-stream.md) ^1.1.1
- [discovery-swarm](https://npm.io/package/discovery-swarm.md) ^3.0.1

## Recent versions

- 2.0.1 (latest) — 2016-03-29
- 1.4.5 — 2016-03-24
- 1.4.4 — 2016-03-18
- 1.4.3 — 2016-03-18
- 1.4.2 — 2016-03-18
- 1.4.1 — 2016-03-18
- 1.4.0 — 2016-03-18
- 1.3.1 — 2016-03-11
- 1.3.0 — 2016-03-09
- 1.2.5 — 2016-03-08
- 1.2.4 — 2016-03-08
- 1.2.2 — 2016-03-07
- 1.2.0 — 2016-03-07
- 1.1.6 — 2016-03-04
- 1.1.5 — 2016-03-03
- … 6 more at https://npm.io/package/dat-manager/versions

## README

# dat-manager

Manages all of your dats on a single machine.

[![Travis](https://api.travis-ci.org/karissa/dat-manager.svg)](https://travis-ci.org/karissa/dat-manager)

## API


### `var manager = Manager(opts)`

Creates a new manager instance. Any saved dats that are marked as 'active' will automatically join their swarm and start sharing data unless `start` is `false`.

##### Options

- `location`: the location on the local filesystem to store the data. defaults to `path.resolve('dats')`
- `db`: the levelup database instance for the manager.
- `datdb`: the levelup database instance for dat.
- `start`: default to `true`

### `Manager.share(key, location, cb)`

Will create a dat link and share the given local filesystem location. It also joins the dat swarm and begins sharing it.

Calls the callback with `cb(err, dat)`

### `Manager.start(key, opts, cb)`

Starts sharing a dat with the given key. If the dat doesn't exist with that key, it creates a new one and begins downloading it.

##### Options
- `link`: the link to use. If not provided, will use the one that is stored.
- `location`: the location to store the data.

### `Manager.stop(key, cb)`

Stops sharing the dat on the swarm.

### `Manager.get(cb)`

Get the metadata for the dat.

### `Manager.list`

List all dats and their metadata.

### `Manager.delete`

Deletes a dat from the system. If currently sharing the dat, will stop sharing it.

### `Manager.close`

Closes all of the swarm and database connections.

## Used by

- [dat-app](http://github.com/karissa/dat-app)
- [dat-server](http://github.com/karissa/dat-server)

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