0.1.0 • Published 5 years ago

catty v0.1.0

Weekly downloads
41
License
MIT
Repository
github
Last release
5 years ago

Catty

Catty is the source file concatenator for 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

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago