# start-ipfs-daemon

> Start an IPFS daemon from Node.js

Latest version **1.2.1** (published 2018-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install start-ipfs-daemon
pnpm add start-ipfs-daemon
yarn add start-ipfs-daemon
bun add start-ipfs-daemon
```

## 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 | 1.2.1 |
| Published | 2018-11-25 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alan Shaw |
| Maintainers | alanshaw |
| Keywords | ipfs, daemon, child, process, spawn, start |

## Links

- npm: https://www.npmjs.com/package/start-ipfs-daemon
- Repository: https://github.com/alanshaw/start-ipfs-daemon
- Homepage: https://github.com/alanshaw/start-ipfs-daemon#readme
- Issues: https://github.com/alanshaw/start-ipfs-daemon/issues
- npm.io page: https://npm.io/package/start-ipfs-daemon

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^1.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [deepmerge](https://npm.io/package/deepmerge.md) ^2.1.1

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-11-25
- 1.2.0 — 2018-11-25
- 1.1.0 — 2018-11-04
- 1.0.1 — 2018-09-21

## README

# start-ipfs-daemon

> Spawn an IPFS daemon from Node.js

## Install

```sh
npm i start-ipfs-daemon
```

## Usage

First install your favourite go-ipfs daemon, you could `npm install go-ipfs-dep`, `brew install ipfs` or whatever.

```js
const startDaemon = require('start-ipfs-daemon')

const daemon = await startDaemon({
  // The path to your IPFS executable.
  // default:
  //   node_modules/go-ipfs-dep/go-ipfs/ipfs (preferred)
  //   node_modules/ipfs/src/cli/bin.js
  // (required if neither of ipfs/go-ipfs-dep installed)
  execPath: '/usr/local/bin/ipfs',
  // Path to your IPFS repo (default shown)
  // Created if not exists
  ipfsPath: '~/.ipfs',
  // Config to merge with your current config at ~/.ipfs/config (optional)
  config: { /* IPFS config */ },
  // Additional CLI arguments to pass to the `ipfs daemon` command
  args: ['--enable-pubsub-experiment']
  // Options for deepmerge (defaults shown)
  // see https://www.npmjs.com/package/deepmerge#arraymerge
  mergeOptions: {
    arrayMerge: function overwrite (_, sourceArray) { return sourceArray }
  },
  // Pipe stdout and stderr to these writeable streams if provided
  stdout: process.stdout,
  stderr: process.stderr
})

// Your go IPFS Daemon is now READY to use

// Your daemon configuration
console.log(daemon.config)

// Maybe you wanna talk to it over the HTTP API?
const IpfsApi = require('ipfs-api')
const ipfs = IpfsApi(daemon.config.Addresses.API)

// Node.js child process
// https://nodejs.org/api/child_process.html#child_process_class_childprocess
// ...enhanced by execa
// https://www.npmjs.com/package/execa
await daemon.process
```

## Contribute

Feel free to dive in! [Open an issue](https://github.com/alanshaw/start-go-ipfs/issues/new) or submit PRs.

## License

[MIT](LICENSE) © Alan Shaw

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