# darp2

> Create a new dat based on the data in another dat.

Latest version **2.0.0** (published 2018-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install darp2
pnpm add darp2
yarn add darp2
bun add darp2
```

Provides the command `darp2`.

## 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.0 |
| Published | 2018-12-19 |
| First published | 2018-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 46.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Martin Heidegger |
| Maintainers | leichtgewicht |
| Keywords | dat, piping, transform |

## Links

- npm: https://www.npmjs.com/package/darp2
- npm.io page: https://npm.io/package/darp2

## Dependencies (12)

- [del](https://npm.io/package/del.md) ^3.0.0
- [cuid](https://npm.io/package/cuid.md) ^2.1.4
- [yargs](https://npm.io/package/yargs.md) ^12.0.5
- [p-queue](https://npm.io/package/p-queue.md) ^3.0.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.3
- [dat-node](https://npm.io/package/dat-node.md) ^3.5.13
- [through2](https://npm.io/package/through2.md) ^3.0.0
- [dat-encoding](https://npm.io/package/dat-encoding.md) ^5.0.1
- [mkdirp-promise](https://npm.io/package/mkdirp-promise.md) ^5.0.1
- [util.promisify](https://npm.io/package/util.promisify.md) ^1.0.0
- [stream-to-promise](https://npm.io/package/stream-to-promise.md) ^2.2.0
- [dat-readdir-stream](https://npm.io/package/dat-readdir-stream.md) ^1.1.0

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-12-19
- 1.0.2 — 2018-06-22
- 1.0.0 — 2018-06-22

## README

# darp² <sub>(Distributed Automated Remote Processing Pipeline)</sub>

[![Build Status](https://travis-ci.org/dotloom/darp2.svg?branch=master)](https://travis-ci.org/dotloom/darp2)

`darp²` is an experimental tool for distributed automated remote processing pipelines for point clouds to be used in conjunction with [DAT](https://datproject.org). Its purpose is to allow processing of data, that is remotely stored in a distributed network without the need to create a local copy of the data first. Instead only necessary data is requested from its peers The data is streamed through a processing pipeline, that writes the result into a directory, that is immediately available as a Dat archive again.

`darp²` can be used as a CLI _(Command Line Interface; aka. terminal)_ tool or as a Node.js library.


## CLI usage

`darp²` is distributed using `npm`, the package manager for Node.js. Please install the latest version of 
Node.js from [the official homepage](https://nodejs.org/en/download/).

To install `darp²` you then type the following command:

```bash
$ npm install darp2 --global
```

Once that succeeds the `darp2` command should be available inside your terminal.

### Options

```bash
$ darp2 --help

darp2 -i dat://... -g "**/*" -c "ls -lash \"\${DARP2_TEMP_FOLDER}\" > ls.out"

Options:
  --version          Show version number                                                   [boolean]
  --input, -i        Input DAT key                                               [string] [required]
  --run-script, -r   Script to run on the task.                                             [string]
  --cmd, -c          Command to run on after downloading the dat.                           [string]
  --work-folder, -w  Folder used for the output. Passed as `DARP2_WORK_FOLDER` and
                     `DARP2_UPLOAD_FOLDER` env variable to the cmd.                         [string]
  --temp-folder, -t  Folder used to download the dat. Passed as `DARP2_TEMP_FOLDER` and
                     `DARP2_DOWNLOAD_FOLDER` env variable to the cmd.                       [string]
  --nolog            Dont write the log file to the out dat.              [boolean] [default: false]
  --log-path         File to write the log into.              [string] [default: ".dat-through.log"]
  --glob, -g                                                              [string] [default: "**/*"]
  --glob-nobrace     Do not expand `{a,b}` and `{1..3}` brace sets.       [boolean] [default: false]
  --glob-noglobstar  Disable `**` matching against multiple folder names. [boolean] [default: false]
  --glob-dot         Allow patterns to match filenames starting with a period, even if
                     the pattern does not explicitly have a period in that spot.

                     Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
                     is set.                                              [boolean] [default: false]
  --glob-noext       Disable "extglob" style patterns like `+(a|b)`.      [boolean] [default: false]
  --glob-nocase      Perform a case-insensitive match.                    [boolean] [default: false]
  --glob-nonull      When a match is not found by `minimatch.match`, return a list containing
                     the pattern itself if this option is set.  When not set, an empty list
                     is returned if there are no matches.                 [boolean] [default: false]
  --glob-matchBase   If set, then patterns without slashes will be matched
                     against the basename of the path if it contains slashes.  For example,
                     `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
                                                                          [boolean] [default: false]
  --glob-nocomment   Suppress the behavior of treating `#` at the start of a pattern as a
                     comment.                                             [boolean] [default: false]
  --glob-nonegate    Suppress the behavior of treating a leading `!` character as negation.
                                                                          [boolean] [default: false]
  --glob-flipNegate  Returns from negate expressions the same as if they were not negated. (Ie, true
                     on a hit, false on a miss.)                          [boolean] [default: false]
  --concurrency, -p  Specifies how many files and folders should be max. processed in parallel.
                                                                               [number] [default: 1]
  --help             Show help                                                             [boolean]
```

### PDAL Example
  
This example shows how `darp²` can take a dat link and then run a processing [pdal][pdal] processing pipeline to pointcloud files and share the output of the processing pipeline with a new dat link:
  
```bash
$ darp2 \
  --input dat://74117a268a95438ceabcde6541dc9f5f00f5c21f192bd14f17258e5ca9ff194b \
  --cmd "pdal pipeline $(pwd)/processing_pipeline.json --readers.las.filename=\"\${DARP2_TEMP_FOLDER}/lidar_raleigh_nc_spm_height_feet.laz\""
```

This example specifies the input as the dat available under the `dat://74117a..b` link. The dat link should start with `dat://` followed by the 64-character hex string.

It runs a pdal processing pipeline that is defined by the `processing_pipeline.json` file (You can download it [here][processing-pipeline])

The output will generate a new dat link ready for sharing.

[pdal]: https://pdal.io/
[processing-pipeline]: https://github.com/dotloom/darp2/tree/master/example/processing_pipeline.json

## License
[MIT License](./LICENSE)

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