# bitinfo

> A graphic generator to help describe bitmaps

Latest version **0.1.1** (published 2022-10-13) · MIT license · 0 weekly downloads

## Install

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

Provides the command `bitinfo`.

## 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.1 |
| Published | 2022-10-13 |
| First published | 2022-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 80.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gustavo Vargas |
| Maintainers | xgvargas |
| Keywords | markdown, bitmap |

## Links

- npm: https://www.npmjs.com/package/bitinfo
- Repository: https://github.com/xgvargas/bitinfo
- Homepage: https://github.com/xgvargas/bitinfo#bitinfo
- Issues: https://github.com/xgvargas/bitinfo/issues
- npm.io page: https://npm.io/package/bitinfo

## Dependencies (3)

- [svgdom](https://npm.io/package/svgdom.md) ^0.1.10
- [commander](https://npm.io/package/commander.md) ^9.1.0
- [@svgdotjs/svg.js](https://npm.io/package/@svgdotjs/svg.js.md) ^3.1.2

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-10-13
- 0.1.0 — 2022-04-02

## README

# bitInfo

BitInfo will read a bitmap description and generate a SVG image to it.

It was designed specially to integrate with [Markdown Preview Enhanced](https://shd101wyy.github.io/markdown-preview-enhanced/#/) and its [Code chunk](https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk) feature.

<!-- ![](https://img.shields.io/github/issues/xgvargas/bitinfo) -->
<!-- ![](https://img.shields.io/github/forks/xgvargas/bitinfo) -->
<!-- ![](https://img.shields.io/github/stars/xgvargas/bitinfo) -->

![](https://img.shields.io/github/license/xgvargas/bitinfo)

## Install

Easy way is to install it globally:

```bash
npm i -g bitinfo
```

## Usage

Markdown Preview Enhanced integrates lots of diagram generator. Since bitInfo is not one of them we must use **code chunk** feature to include it.

Simple add a fenced block and add a call to the bitinfo (change its path if not globally installed):

````markdown
```bitinfo {cmd="bitinfo", args=["-i"] output="html" hide}
size 16
15 response =x "this is a response" #fdd
14..13 Func1,Func2 =00
highlight 14..13 "function selector"
7..0 =xxxxx10x
highlight 7..0 #88f "message ID"
10 Unicast
```
````

Then use any of commands `Run Code Chunk` or `Run All Code Chunk` to generate diagrams.

<!-- ```bitinfo {cmd="bitinfo", args=["-i"] output="html" hide}
size 16
15 response =x "this is a response" #fdd
14..13 Func1,Func2 =00
highlight 14..13 "function selector"
7..0 =xxxxx10x
highlight 7..0 #88f "message ID"
10 Unicast
``` -->

![example1](images/example1.png)

## bitInfo description tags

| tag                                               | function                                 | default |
| ------------------------------------------------- | ---------------------------------------- | ------- |
| scale \<num>                                      | diagram scale                            | 1       |
| size \<range>                                     | registry size                            | 15..0   |
| bitGap \<num>                                     | space between bits                       | 3       |
| nibbleGap \<num>                                  | extra space between nibbles              | 0       |
| byteGap \<num>                                    | extra space between bytes                | 6       |
| vertical                                          | **TODO**                                 |         |
| default \<value>                                  | default value for non declared bits      |         |
| background \<color>                               | can you guess?                           | white   |
| highlight \<range> \[color] \["legend"]           | set color and legend for a range of bits |         |
| \<range> \[:names] \[=values] \["descr"] \[color] | define a bit range                       |         |

| type  | pattern example                                 |
| ----- | ----------------------------------------------- |
| range | `1..16` or `15..0` (both ends are inclusive)    |
| range | `24` (simplified form of `23..0`)               |
| num   | integer or float                                |
| value | `[01X?CZ]`                                      |
| color | `#123` or `orange` (any css color can be named) |

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