Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

yosay

Package Overview
Dependencies
Maintainers
7
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yosay - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

47

index.js

@@ -10,7 +10,9 @@ 'use strict';

var repeating = require('repeating');
var cliBoxes = require('cli-boxes');
var topOffset = 3;
var border = cliBoxes.round;
var topOffset = 4;
var leftOffset = 17;
var defaultGreeting =
'\n _-----_' +
'\n _-----_ ' +
'\n | | ' +

@@ -20,3 +22,3 @@ '\n |' + chalk.red('--(o)--') + '| ' +

'\n ' + chalk.yellow('(') + ' _' + chalk.yellow('ยดU`') + '_ ' + chalk.yellow(')') + ' ' +
'\n /___A___\\ ' +
'\n /___A___\\ /' +
'\n ' + chalk.yellow('| ~ |') + ' ' +

@@ -26,2 +28,10 @@ '\n __' + chalk.yellow('\'.___.\'') + '__ ' +

// A total line with 45 characters consists of:
// 28 chars for the top frame of the speech bubble โ†’ `โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`
// 17 chars for the yeoman character ยปcolumnยซ โ†’ ` /___A___\ /`
var TOTAL_CHARACTERS_PER_LINE = 45;
// The speech bubble will overflow the Yeoman character if the message is too long.
var MAX_MESSAGE_LINES_BEFORE_OVERFLOW = 7;
module.exports = function (message, options) {

@@ -63,6 +73,8 @@ message = (message || 'Welcome to Yeoman, ladies and gentlemen!').trim();

var borderHorizontal = repeating(border.horizontal, maxLength + 2);
frame = {
top: '.' + repeating('-', maxLength + 2) + '.',
side: ansiStyles.reset.open + '|' + ansiStyles.reset.open,
bottom: ansiStyles.reset.open + '\'' + repeating('-', maxLength + 2) + '\''
top: border.topLeft + borderHorizontal + border.topRight,
side: ansiStyles.reset.open + border.vertical + ansiStyles.reset.open,
bottom: ansiStyles.reset.open + border.bottomLeft + borderHorizontal + border.bottomRight
};

@@ -128,2 +140,25 @@

if (index === 0) {
// Need to adjust the top position of the speech bubble depending on the
// amount of lines of the message.
if (array.length === 2) {
topOffset -= 1;
}
if (array.length >= 3) {
topOffset -= 2;
}
// The speech bubble will overflow the Yeoman character if the message
// is too long. So we vertically center the bubble by adding empty lines
// on top of the greeting.
if (array.length > MAX_MESSAGE_LINES_BEFORE_OVERFLOW) {
var emptyLines = Math.ceil((array.length - MAX_MESSAGE_LINES_BEFORE_OVERFLOW) / 2);
for (var i = 0; i < emptyLines; i++) {
greeting.unshift('');
}
frame.top = pad.left(frame.top, TOTAL_CHARACTERS_PER_LINE);
}
greeting[topOffset - 1] += frame.top;

@@ -130,0 +165,0 @@ }

3

package.json
{
"name": "yosay",
"version": "1.1.1",
"version": "1.2.0",
"description": "Tell Yeoman what to say",

@@ -36,2 +36,3 @@ "license": "BSD-2-Clause",

"chalk": "^1.0.0",
"cli-boxes": "^1.0.0",
"pad-component": "0.0.1",

@@ -38,0 +39,0 @@ "repeating": "^2.0.0",

@@ -25,9 +25,9 @@ # yosay [![Build Status](https://travis-ci.org/yeoman/yosay.svg?branch=master)](https://travis-ci.org/yeoman/yosay)

/*
_-----_
| | .--------------------------.
|--(o)--| | Hello, and welcome to my |
`---------ยด | fantastic generator full |
( _ยดU`_ ) | of whimsy and bubble |
/___A___\ | gum! |
| ~ | '--------------------------'
_-----_ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
| | โ”‚ Hello, and welcome to my โ”‚
|--(o)--| โ”‚ fantastic generator full โ”‚
`---------ยด โ”‚ of whimsy and bubble โ”‚
( _ยดU`_ ) โ”‚ gum! โ”‚
/___A___\ /โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
| ~ |
__'.___.'__

@@ -59,7 +59,7 @@ ยด ` |ยฐ ยด Y `

_-----_
| | .--------------------------.
|--(o)--| | Sindre is a horse |
`---------ยด '--------------------------'
( _ยดU`_ )
/___A___\
| |
|--(o)--| โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
`---------ยด โ”‚ Sindre is a horse โ”‚
( _ยดU`_ ) โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
/___A___\ /
| ~ |

@@ -66,0 +66,0 @@ __'.___.'__

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc