# pixelbar

> Generate precise progress bars in terminals with the power of unicode

Latest version **1.0.0** (published 2017-07-09) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-07-09 |
| First published | 2017-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Idan Gazit |
| Maintainers | idangazit |

## Links

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

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.0.1
- [d3-scale](https://npm.io/package/d3-scale.md) ^1.0.6

## Recent versions

- 1.0.0 (latest) — 2017-07-09

## README

# pixelbar

A better way to generate bars, using the power of unicode.

## Install

`yarn add pixelbar`

## Usage

```
import pixelBar from 'pixelbar'
```

### Simple bars with no options
```
const barText = pixelBar(0, 10) // '[          ]'
const barText = pixelBar(1, 10) // '[█         ]'
const barText = pixelBar(5, 10) // '[█████     ]'
```

### Fancier bars with options
```
const barText = pixelBar(1, 10, {caps: false}) // '█         '
const barText = pixelBar(1, 10, {width: 20}) // '[██                  ]'
```

### Style the color of the bar

You can supply any [chalk](https://github.com/chalk/chalk#colors) function(s) to spruce up the coloring. No colorful previews below because markdown doesn't support the styling, but you get the idea:

```
// red bar
const barText = pixelBar(1, 10, {style: chalk.red})

// red bar on white bg
const barText = pixelBar(1, 10, {style: chalk.red.bgWhite})
```

# Created by

[Idan Gazit](https://github.com/idan)

# License

MIT © [Idan Gazit](https://twitter.com/idangazit)

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