# pikchr

> Pikchr addon source package

Latest version **0.0.5** (published 2020-12-29) · 0BSD license · 0 weekly downloads

## Install

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

## 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.0.5 |
| Published | 2020-12-29 |
| First published | 2020-12-26 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 334.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 5 |
| Author | David Weil |
| Maintainers | tenuki |

## Links

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

## Dependencies (1)

- [bindings](https://npm.io/package/bindings.md) ~1.2.1

## Recent versions

- 0.0.5 (latest) — 2020-12-29
- 0.0.4 — 2020-12-27
- 0.0.3 — 2020-12-27
- 0.0.2 — 2020-12-27
- 0.0.1 — 2020-12-26

## README

Pikchr - Diagram renderer
=========================

[![Actions Status](https://github.com/tenuki/pikchr/workflows/On%20Commit%20Build%20and%20Tests/badge.svg)](https://github.com/tenuki/pikchr/actions)
[![Actions Status](https://github.com/tenuki/pikchr/workflows/On%20new%20release%20Build%20and%20Tests/badge.svg)](https://github.com/tenuki/pikchr/actions)


Taken from the [pikchr](https://pikchr.org/home/doc/trunk/homepage.md) homepage:

> Pikchr (pronounced like "picture") is a [PIC][1]-like markup
> language for diagrams in technical documentation.  Pikchr is
> designed to be embedded in [fenced code blocks][2] of
> Markdown (or in similar mechanisms in other markup languages)
> to provide a convenient means of showing diagrams.
> 
> [1]: https://en.wikipedia.org/wiki/Pic_language
> [2]: https://spec.commonmark.org/0.29/#fenced-code-blocks

This is the source version addon for nodejs. It uses node's NAPI which makes 
it compatible with many node versions.

You can use it as follows:

```javascript
const pikchr = require('pikchr');

pikchr.pikchr('line ; box "Hello," "World!"; arrow') // -> svg string

pikchr.pikchrex('line ; box "Hello!"', options={}) // -> result object
```

Where allowed `options` are: 
 * `class_name`: a string for root svg's class attribute
 * `dark_mode`: when this flag is used, Pikchr inverts the colors in the 
   diagram to make them suitable for "dark mode" pages. The main Pikchr website has a dark-mode counterpart that you can visit to see the effects of this flag on Pikchr diagrams
 * `text_errors`: mormally, the text returned by pikchr in the event of an 
   error is formatted as HTML. Setting this flag causes the error message to be plain text

 `text_errors` and `dark_mode` must be booleans and `class_name` a string. 
 All of them are optional.


Check _flags passed to pikchr_ in [pikchr documentation][1] for more 
detailed information.


[1]: https://pikchr.org/home/doc/trunk/doc/integrate.md

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