# catty

> Mapshaper's build tool

Latest version **0.1.0** (published 2019-10-01) · MIT license · 0 weekly downloads

## Install

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

Provides the command `catty`.

## 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.1.0 |
| Published | 2019-10-01 |
| First published | 2015-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Matthew Bloch |
| Maintainers | mbloch |
| Keywords | mapshaper |

## Links

- npm: https://www.npmjs.com/package/catty
- Repository: https://github.com/mbloch/catty
- Issues: https://github.com/mbloch/catty/issues
- npm.io page: https://npm.io/package/catty

## Dependencies (2)

- [nomnom](https://npm.io/package/nomnom.md) ~1.8
- [underscore](https://npm.io/package/underscore.md) ~1.7

## Recent versions

- 0.1.0 (latest) — 2019-10-01
- 0.0.9 — 2019-10-01
- 0.0.8 — 2016-06-18
- 0.0.7 — 2016-02-08
- 0.0.6 — 2016-02-05
- 0.0.5 — 2015-10-26
- 0.0.4 — 2015-06-30
- 0.0.3 — 2015-06-29
- 0.0.2 — 2015-01-18
- 0.0.1 — 2015-01-18

## README

## Catty ##

Catty is the source file concatenator for [Mapshaper](https://github.com/mbloch/mapshaper).

Some features:

* Each source file lists its dependencies in a formatted comment (see below). There is no manifest, unlike some other tools.
* Concatenated files are (optionally) wrapped in a self-executing function, to protect the global namespace.
* Catty can monitor source files and regenerate output files when a required source file changes.

### Command line tool ###

Usage: `$ catty [options] input output`

Options:
- `-f` Monitor source files, re-cat when something changes.
- `-g` Don't wrap source files in an immediate function.
- `-d` Comma-separated list of directories to monitor
- `-h` Print help message

Example: `$ catty -g -d src,lib src/input.js dist/output.js`

### Node module ###

**Example**
```
require('catty')({global: true})
	.addLibrary('src')
	.addLibrary('lib')
	.cat('src/input.js', 'dist/output.js');
```

**Methods**

`#cat(input, output)`  Concatenate an input file with its dependencies. `output` may be a filename or a Node-style callback. If `output` is empty or contains a hyphen, catty sends its output to `stdout`.

`#addLibrary(dir)`  Give catty a directory to search for dependencies.

`#prepend(JS)`  Insert JavaScript before concatenated code.

`#addDeps(deps)`  Inject one or more additional dependencies into the input file (comma-sep. list).

### Comment format ###

**Examples**

```
/* @requires
mapshaper-innerlines
mapshaper-endpoints
mapshaper-dataset-utils
*/
```

```
/* @requires mapshaper-shapes, mapshaper-shape-geom */
```
ls

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