# veco

> A toolchain for svg generation

Latest version **0.4.0** (published 2021-08-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

Provides the command `veco`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2021-08-15 |
| First published | 2020-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 22 |
| Unpacked size | 256.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Max J. Polster |
| Maintainers | mpt |

## Links

- npm: https://www.npmjs.com/package/veco
- Repository: https://github.com/mxjp/veco
- Homepage: https://github.com/mxjp/veco#readme
- Issues: https://github.com/mxjp/veco/issues
- npm.io page: https://npm.io/package/veco

## Dependencies (22)

- [ws](https://npm.io/package/ws.md) ^8.1.0
- [svgo](https://npm.io/package/svgo.md) ^2.4.0
- [color](https://npm.io/package/color.md) ^4.0.1
- [json5](https://npm.io/package/json5.md) ^2.2.0
- [canvas](https://npm.io/package/canvas.md) ^2.8.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [express](https://npm.io/package/express.md) ^4.17.1
- [is-glob](https://npm.io/package/is-glob.md) ^4.0.1
- [resolve](https://npm.io/package/resolve.md) ^1.20.0
- [anymatch](https://npm.io/package/anymatch.md) ^3.1.2
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.2
- [klaw-sync](https://npm.io/package/klaw-sync.md) ^6.0.0
- [bufferutil](https://npm.io/package/bufferutil.md) ^4.0.3
- [typescript](https://npm.io/package/typescript.md) ^4.3.5
- [@types/node](https://npm.io/package/@types/node.md) ^16.6.1
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^4.1.1
- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3
- [file-loader](https://npm.io/package/file-loader.md) ^6.2.0
- [@types/color](https://npm.io/package/@types/color.md) ^3.0.2
- [utf-8-validate](https://npm.io/package/utf-8-validate.md) ^5.0.5
- [@phylum/command](https://npm.io/package/@phylum/command.md) ^1.2.0
- [v8-compile-cache](https://npm.io/package/v8-compile-cache.md) ^2.3.0

## Recent versions

- 0.4.0 (latest) — 2021-08-15
- 0.3.6 — 2020-10-10
- 0.3.5 — 2020-06-07
- 0.3.4 — 2020-06-07
- 0.3.3 — 2020-04-27
- 0.3.2 — 2020-04-27
- 0.3.1 — 2020-03-16
- 0.3.0 — 2020-03-15
- 0.2.0 — 2020-03-15
- 0.1.6 — 2020-03-13
- 0.1.5 — 2020-03-13
- 0.1.4 — 2020-03-12
- 0.1.3 — 2020-03-12
- 0.1.2 — 2020-03-12
- 0.1.0 — 2020-03-11
- … 1 more at https://npm.io/package/veco/versions

## README

# VECO
A toolchain for creating **ve**ctor graphics from **co**de for developers :)

**This is an early proof of concept. Use at your own risk!**

## Why/how?
From a developer's perspective, large sets of svg icons are hard to create and maintain as
even modern graphic software makes it hard to reuse parts or parametize things. Veco solves all
these problems by allowing you to write svgs in typescript:
```tsx
import { render, emit } from "veco";

emit(<svg viewBox="0 0 100 100">
	{[[20, "red"], [40, "blue"], [60, "green"]].map(([radius, fill]) => {
		return <circle cx="50" cy="50" r={radius} fill={fill} />
	})}
</svg>)
```

<br>



# Getting started

## Installation
```shell
npm i -D veco
```

## Configuration
Create a configuration file for your project:
```js
// veco.json5
{
	// Note, that all properties are optional and
	// the following values represent the defaults:

	// An object with typescript compiler options:
	compilerOptions: {
		target: "es2019",
		jsxFactory: "render"
	},

	// An array with globs to include:
	include: ["**"],

	// An array with globs to exclude:
	exclude: ["**/node_modules/**"],

	// The render target.
	//  - xml - Standalone xml svg files.
	//  - dom - Svg files for direct use in html documents.
	//  - png - PNG images.
	//  - jpeg - JPEG images.
	target: "xml",

	// Render quality used for jpeg images:
	quality: 1,

	// The pixel scale used for PNG and JPEG images:
	scale: 1,

	// An object with format options:
	format: {
		indent: "\t",
		newline: "\n"
	},

	// Settings for the preview server:
	preview: {
		port: 3000,
		address: "::1"
	},

	// Enable/disable optimization (currently uses svgo):
	optimize: true
}
```

## Command line
```shell
# Render all svgs:
veco render

# Start the preview server:
veco preview
```

The following arguments can be used to overwrite the configuration:

| Argument | Description | Commands |
|-|-|-|
| `--config ./foo.json5` | Optional config file path | render, preview |
| `--watch` | Watch for changes | render |
| `--include ./src/foo/**` | Specify one or more globs to include files | render, preview |
| `--exclude **/test*` | Specify one or more globs to exclude files | render, preview |
| `--out-dir ./out` | Specify a different output directory | render |
| `--target png` | Specify a different render target | render |
| `--quality 0.84` | Specify a different JPEG render quality | render |
| `--scale 1.234` | Specify a different scale for PNG or JPEG images | render |
| `--preview-port 3000` | Use a different preview server port | preview |
| `--preview-address ::1` | Use a different preview server address | preview |
| `--verbose` | Enable verbose logging | *all* |

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