# choices-separator

> Separator for choices arrays in prompts. Based on the Separator from inquirer.

Latest version **2.0.0** (published 2017-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install choices-separator
pnpm add choices-separator
yarn add choices-separator
bun add choices-separator
```

## 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 | 2.0.0 |
| Published | 2017-05-17 |
| First published | 2016-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | answer, answers, ask, checkbox, choice, choices, cli, command, enquirer, enquirerprompt, input, inquire, inquirer, interact, list, menu, password, prompt, prompts, question, readline, separator, stdin, stdout, terminal, tty, ui |

## Links

- npm: https://www.npmjs.com/package/choices-separator
- Repository: https://github.com/enquirer/choices-separator
- Issues: https://github.com/enquirer/choices-separator/issues
- npm.io page: https://npm.io/package/choices-separator

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2.6.6
- [ansi-dim](https://npm.io/package/ansi-dim.md) ^0.1.1
- [strip-color](https://npm.io/package/strip-color.md) ^0.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-17
- 1.1.0 — 2017-05-09
- 1.0.0 — 2017-05-05
- 0.1.2 — 2016-09-21
- 0.1.1 — 2016-09-03
- 0.1.0 — 2016-08-29

## README

# choices-separator [![NPM version](https://img.shields.io/npm/v/choices-separator.svg?style=flat)](https://www.npmjs.com/package/choices-separator) [![NPM monthly downloads](https://img.shields.io/npm/dm/choices-separator.svg?style=flat)](https://npmjs.org/package/choices-separator) [![NPM total downloads](https://img.shields.io/npm/dt/choices-separator.svg?style=flat)](https://npmjs.org/package/choices-separator) [![Linux Build Status](https://img.shields.io/travis/enquirer/choices-separator.svg?style=flat&label=Travis)](https://travis-ci.org/enquirer/choices-separator)

> Separator for choices arrays in prompts. Based on the Separator from inquirer.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save choices-separator
```

## Usage

```js
var Separator = require('choices-separator');
var Prompt = require('prompt-checkbox');

var prompt = new Prompt({
  message: 'Which do you prefer?',
  name: 'favorites',
  choices: [
    new Separator(' = Color = '),
    {name: 'red'},
    {name: 'yellow', checked: true },
    {name: 'blue'},
    new Separator(' = Shape = '),
    {name: 'circle'},
    {name: 'triangle'},
    {name: 'square'}
  ]
});

prompt.run()
  .then(function(answer) {
    console.log(answer)
  });
```

## API

### [Separator](index.js#L21)

Separator object, used in choices arrays in prompts, to create a visual break between sections. The default separator line is `────────` styled with [ansi-dim](https://github.com/jonschlinkert/ansi-dim).

**Params**

* `options` **{String}**: Optionally provide a custom `line` and or `prefix` to use.

**Example**

```js
new Separator('----');
new Separator({line: '----'})
new Separator({line: '----', prefix: '    '});
```

### [.raw](index.js#L56)

Returns the `separator.line` stripped of ansi styling.

* `returns` **{String}**

**Example**

```js
var separator = new Separator();
console.log(separator.raw());
//=> '────────'
```

### [.render](index.js#L72)

Render `separator.prefix` plus `separator.line`.

* `returns` **{String}**

**Example**

```js
var separator = new Separator();
console.log(separator.render());
//=> ' \u001b[2m────────\u001b[22m\n')
```

### [.exclude](index.js#L83)

Returns false if the given object is a separator.

**Params**

* `choice` **{Object}**: object to test against
* `returns` **{Boolean}**: Returns false if the given object is a separator

### [.toString](index.js#L93)

Stringify separator

* `returns` **{String}**: Returns the `separator.line` string

## Attribution

Originally inspired by the `Separator` class from Inquirer.

## About

### Related projects

[enquirer](https://www.npmjs.com/package/enquirer): Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all… [more](https://github.com/enquirer/enquirer) | [homepage](https://github.com/enquirer/enquirer "Intuitive, plugin-based prompt system for node.js. Much faster and lighter alternative to Inquirer, with all the same prompt types and more, but without the bloat.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 17, 2017._

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