<commit_before>Render 1-D barcodes to canvas, svg, or path.  Supports Code 128, 3 of 9, 2 of 5, EAN, and more.

## Why?
This barcode library has no dependencies 👍.

This barcode library specializes in its use of the canvas API.  You provide a canvas (be it in a browser or with [node-canvas](https://github.com/Automattic/node-canvas)), and then specify where the barcode should be drawn, how large it should be, and at what angle.

Other barcode libraries that I found created pngs or svgs directly and were not very flexible in the output size (i.e. no `maxWidth` option).  Rendering directly to a canvas allows for a flexible API if that's your target anyway.

## Demos/Playground
First of all, check out the [demos](https://froatsnook.github.io/bardcode/).

## Barcode Generator

Did you ever want to paste a list of strings and download a zip file of corresponding images?  Well I did once and made this [barcode-generator](https://froatsnook.github.io/barcode-generator).  See demos for the source.

## How?
```js
// In the browser
var canvas = document.getElementById("barcode-canvas");
var g = canvas.getContext("2d");
drawBarcode(g, "Test barcode", options);
```

```js
// On the server
var bardcode = require("bardcode");<commit_msg>Add note about SVG and Path in README intro.<commit_after>Render 1-D barcodes to canvas, svg, or path.  Supports Code 128, 3 of 9, 2 of 5, EAN, and more.

## Why?
This barcode library has no dependencies 👍.

This barcode library specializes in its use of the canvas API.  You provide a canvas (be it in a browser or with [node-canvas](https://github.com/Automattic/node-canvas)), and then specify where the barcode should be drawn, how large it should be, and at what angle.

Other barcode libraries that I found created pngs or svgs directly and were not very flexible in the output size (i.e. no `maxWidth` option).  Rendering directly to a canvas allows for a flexible API if that's your target anyway.  You can also easily generate SVG or Path text output.

## Demos/Playground
First of all, check out the [demos](https://froatsnook.github.io/bardcode/).

## Barcode Generator

Did you ever want to paste a list of strings and download a zip file of corresponding images?  Well I did once and made this [barcode-generator](https://froatsnook.github.io/barcode-generator).  See demos for the source.

## How?
```js
// In the browser
var canvas = document.getElementById("barcode-canvas");
var g = canvas.getContext("2d");
drawBarcode(g, "Test barcode", options);
```

```js
// On the server
var bardcode = require("bardcode");
{'fraction_non_alphanumeric': 0.09564541213063764, 'fraction_numerical': 0.006998444790046656, 'mean_word_length': 4.251020408163265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2571787', 'n_tokens_mistral': 778, 'n_tokens_neox': 747, 'n_words': 359}