Comparing version 0.2.0 to 0.2.1
17
index.js
@@ -21,8 +21,17 @@ 'use strict'; | ||
module.exports = function (message, options) { | ||
message = message || 'Welcome to Yeoman, ladies and gentlemen!'; | ||
message = (message || 'Welcome to Yeoman, ladies and gentlemen!').trim(); | ||
options = options || {}; | ||
var maxLength = options.maxLength || 24; | ||
var maxLength = 24; | ||
var frame; | ||
var frame = { | ||
if (options.maxLength) { | ||
maxLength = message.toLowerCase().split(' ').sort()[0].length; | ||
if (maxLength < options.maxLength) { | ||
maxLength = options.maxLength; | ||
} | ||
} | ||
frame = { | ||
top: '.' + pad('', maxLength + 2, '-') + '.', | ||
@@ -33,3 +42,3 @@ side: '|', | ||
return wrap(message.trim(), { width: maxLength }) | ||
return wrap(message, { width: maxLength }) | ||
.split(/\n/) | ||
@@ -36,0 +45,0 @@ .reduce(function (greeting, str, index, array) { |
{ | ||
"name": "yosay", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Tell Yeoman what to say", | ||
@@ -5,0 +5,0 @@ "license": "BSD", |
@@ -5,2 +5,4 @@ # yosay [![Build Status](https://travis-ci.org/yeoman/yosay.svg?branch=master)](https://travis-ci.org/yeoman/yosay) | ||
Like [cowsay](http://en.wikipedia.org/wiki/Cowsay), but less cow. | ||
![](screenshot.png) | ||
@@ -21,3 +23,3 @@ | ||
yosay('Hello, and welcome to my fantastic generator full of whimsy and bubble gum!'); | ||
console.log(yosay('Hello, and welcome to my fantastic generator full of whimsy and bubble gum!')); | ||
@@ -24,0 +26,0 @@ /* |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4736
95
67
0