# @afoot/divide

> Add a lil’ divider string beneath a source string. Use it to create separation in console logs or stdout.

Latest version **0.1.0** (published 2022-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @afoot/divide
pnpm add @afoot/divide
yarn add @afoot/divide
bun add @afoot/divide
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-11-12 |
| First published | 2022-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthew Smith |
| Maintainers | niftinessafoot |
| Keywords | module, typescript, string |

## Links

- npm: https://www.npmjs.com/package/@afoot/divide
- Repository: https://github.com/niftinessafoot/divide
- Issues: https://github.com/niftinessafoot/divide/issues
- npm.io page: https://npm.io/package/@afoot/divide

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2022-11-12

## README

# @afoot/divide

Add a lil’ divider string beneath a source string. Use it to create separation in console logs or stdout.

## usage

Provide a string and it will return the string and a divider of equal length on a separate line.

```js
const output = divide('string');
/* Returns:
string
-----
*/
console.log(output);
```

### config options

#### character

Normally returning a series of hyphens, you can specify any combination of characters with the `character` key in the config object.

```js
const output = divide('string', { character: '•–' });
/* Returns:
string
•–•–•–
*/
console.log(output);
```

#### width

Override the default string length by specifiying a numeric override with `width`.

```js
const output = divide('string', { width: 10 });
/* Returns:
string
----------
*/
console.log(output);
```

Setting `width` to less than one omits the divider

```js
const output = divide('string', { width: -1 });
/* Returns:
string
*/
console.log(output);
```

#### omitSource

Return _just_ the divider with a length equal to the input length

```js
const output = divide('string', { omitSource: true });
/* Returns:
------
*/
console.log(output);
```

### bypass input

Create a divider by passing in _only_ a config object with at least a `width`.

```js
const output = divide({ width: 5, character: '•' });
/* Returns:
•••••
*/
console.log(output);
```

## what is this for?

In honesty, I made this to test Rollup, continuous integrations, and npm packages, but it totally does what it says on the box, too!

## license

[MIT](./LICENSE) © [Matthew Smith](http://www.niftinessafoot.com)

## made with ❤️ and ☕️ by

![Niftiness Afoot!](https://gist.githubusercontent.com/niftinessafoot/2dba588395cb557293d5f09aebcd2ab0/raw/770293c76bead4f0986ff959f3ea8880017d92c0/bot.svg?sanitize=true) [Matthew Smith](https://github.com/niftinessafoot)

```

```

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