# output-formatter

> format helper for output

Latest version **1.0.2** (published 2016-06-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install output-formatter
pnpm add output-formatter
yarn add output-formatter
bun add output-formatter
```

## 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.2 |
| Published | 2016-06-20 |
| First published | 2016-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bencode@163.com |
| Maintainers | bencode |

## Links

- npm: https://www.npmjs.com/package/output-formatter
- Repository: https://github.com/bencode/output-formatter
- Homepage: https://github.com/bencode/output-formatter#readme
- Issues: https://github.com/bencode/output-formatter/issues
- npm.io page: https://npm.io/package/output-formatter

## Recent versions

- 1.0.2 (latest) — 2016-06-20
- 1.0.1 — 2016-02-17
- 1.0.0 — 2016-02-17

## README

# output-formatter


[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]


format helper for output


```js
const fmt = require('output-formatter');
```


## fmt.left(str, len)


```js
fmt.left('hello', 10).should.equal('hello     ');
fmt.left('hello', 5).should.equal('hello');
fmt.left('hello', 2).should.equal('hello');
fmt.left(234, 5).should.equal('234  ');
fmt.left(null, 5).should.equal('null ');
```


## fmt.center(str, len)


```js
fmt.center('hi', 10).should.be.equal('    hi    ');
fmt.center('hi', 9).should.be.equal('   hi    ');
fmt.center('hi', 2).should.be.equal('hi');
fmt.center('hi', 1).should.be.equal('hi');
fmt.center(0, 5).should.equal('  0  ');
fmt.center(undefined, 5).should.equal('undefined');
```


## fmt.right(str, len)


```js
fmt.right('world', 10).should.be.equal('     world');
fmt.right('world', 5).should.be.equal('world');
fmt.right('world', 1).should.be.equal('world');
fmt.right(true, 1).should.equal('true');
```


## fmt.line(ch, num)


```js
fmt.line('-', 5).should.be.equal('-----');
fmt.line('+', 0).should.be.equal('');
```

## fmt.red(msg)


```js
console.log(fmt.red('hello world'));

```


## fmt.yellow(msg)


```js
console.log(fmt.yellow('warning'));
```


[npm-image]: https://img.shields.io/npm/v/output-formatter.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/output-formatter
[travis-image]: https://img.shields.io/travis/bencode/output-formatter/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/bencode/output-formatter
[coveralls-image]: https://img.shields.io/codecov/c/github/bencode/output-formatter.svg?style=flat-square
[coveralls-url]: https://codecov.io/github/bencode/output-formatter?branch=master

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