choices-separator
Advanced tools
Comparing version 0.1.2 to 1.0.0
22
index.js
'use strict'; | ||
var extend = require('extend-shallow'); | ||
var debug = require('debug')('choices-separator'); | ||
var repeat = require('repeat-string'); | ||
var gray = require('ansi-gray'); | ||
var dim = require('ansi-dim'); | ||
@@ -15,14 +16,17 @@ /** | ||
function Separator(line) { | ||
function Separator(line, options) { | ||
debug('initializing from <%s>', __filename); | ||
this.isSeparator = true; | ||
this.prefix = ' '; | ||
this.type = 'separator'; | ||
if (typeof line !== 'string') { | ||
options = line; | ||
line = null; | ||
} | ||
var opts = extend({line: line}, options); | ||
this.prefix = opts.prefix || ' '; | ||
this.chars = {middot: '·', line: '─', bullet: '•'}; | ||
this.line = this.chars[line] || line; | ||
if (!this.line) { | ||
this.line = gray(repeat(this.chars.line, 8)); | ||
} else { | ||
this.line = gray(this.line); | ||
} | ||
this.line = dim(this.chars[opts.line] | ||
|| opts.line | ||
|| repeat(this.chars.line, 8)); | ||
} | ||
@@ -29,0 +33,0 @@ |
{ | ||
"name": "choices-separator", | ||
"description": "Separator for choices arrays in prompts. Based on the Separator from inquirer.", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/enquirer/choices-separator", | ||
@@ -22,12 +22,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
}, | ||
"dependencies": { | ||
"ansi-gray": "^0.1.1", | ||
"debug": "^2.2.0", | ||
"repeat-string": "^1.5.4" | ||
}, | ||
"devDependencies": { | ||
"gulp-format-md": "^0.1.10", | ||
"mocha": "^3.0.2", | ||
"strip-color": "^0.1.0" | ||
}, | ||
"keywords": [ | ||
@@ -83,3 +73,14 @@ "answer", | ||
] | ||
}, | ||
"dependencies": { | ||
"ansi-dim": "^0.1.1", | ||
"debug": "^2.6.6", | ||
"extend-shallow": "^2.0.1", | ||
"repeat-string": "^1.6.1" | ||
}, | ||
"devDependencies": { | ||
"gulp-format-md": "^0.1.12", | ||
"mocha": "^3.3.0", | ||
"strip-color": "^0.1.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# choices-separator [![NPM version](https://img.shields.io/npm/v/choices-separator.svg?style=flat)](https://www.npmjs.com/package/choices-separator) [![NPM downloads](https://img.shields.io/npm/dm/choices-separator.svg?style=flat)](https://npmjs.org/package/choices-separator) [![Build Status](https://img.shields.io/travis/enquirer/choices-separator.svg?style=flat)](https://travis-ci.org/enquirer/choices-separator) | ||
# 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) | ||
@@ -52,3 +52,3 @@ > Separator for choices arrays in prompts. Based on the Separator from inquirer. | ||
[enquirer](https://www.npmjs.com/package/enquirer): Plugin-based prompt system for node.js | [homepage](https://github.com/jonschlinkert/enquirer "Plugin-based prompt system for node.js") | ||
[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.") | ||
@@ -61,8 +61,8 @@ ### Contributing | ||
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ | ||
_(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 and API documentation with [verb](https://github.com/verbose/verb): | ||
To generate the readme, run the following command: | ||
```sh | ||
$ npm install -g verb verb-generate-readme && verb | ||
$ npm install -g verbose/verb#dev verb-generate-readme && verb | ||
``` | ||
@@ -72,6 +72,6 @@ | ||
Install dev dependencies: | ||
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 -d && npm test | ||
$ npm install && npm test | ||
``` | ||
@@ -84,11 +84,11 @@ | ||
* [github/jonschlinkert](https://github.com/jonschlinkert) | ||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) | ||
### License | ||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT license](https://github.com/enquirer/choices-separator/blob/master/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.1.30, on September 03, 2016._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 05, 2017._ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7158
55
0
4
+ Addedansi-dim@^0.1.1
+ Addedextend-shallow@^2.0.1
+ Addedansi-dim@0.1.1(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedis-extendable@0.1.1(transitive)
- Removedansi-gray@^0.1.1
- Removedansi-gray@0.1.1(transitive)
Updateddebug@^2.6.6
Updatedrepeat-string@^1.6.1