Comparing version 1.1.9 to 1.2.0
@@ -1,5 +0,3 @@ | ||
var os = require("os"); | ||
exports.say = function (text, wrap) { | ||
delimiters = { | ||
var delimiters = { | ||
first : ["/", "\\"], | ||
@@ -15,3 +13,3 @@ middle : ["|", "|"], | ||
exports.think = function (text, wrap) { | ||
delimiters = { | ||
var delimiters = { | ||
first : ["(", ")"], | ||
@@ -33,3 +31,3 @@ middle : ["(", ")"], | ||
balloon = [ | ||
" " + top(maxLength), | ||
" " + top(maxLength), | ||
delimiters.only[0] + " " + lines[0] + " " + delimiters.only[1], | ||
@@ -58,3 +56,3 @@ " " + bottom(maxLength) | ||
return balloon.join("\n"); //os.EOL | ||
return balloon.join("\n"); | ||
} | ||
@@ -61,0 +59,0 @@ |
{ | ||
"name": "cowsay", | ||
"version": "1.1.9", | ||
"version": "1.2.0", | ||
"description": "cowsay is a configurable talking cow", | ||
@@ -19,3 +19,6 @@ "keywords": [ | ||
}, | ||
"license": "MIT", | ||
"main": "./index", | ||
"module": "./build/cowsay.es.js", | ||
"browser": "./build/cowsay.umd.js", | ||
"bin": { | ||
@@ -28,2 +31,3 @@ "cowsay": "./cli.js", | ||
"cli.js", | ||
"build/", | ||
"cows/", | ||
@@ -37,2 +41,3 @@ "lib/" | ||
"scripts": { | ||
"prepublish": "rollup -c", | ||
"test": "node test.js" | ||
@@ -45,5 +50,12 @@ }, | ||
"devDependencies": { | ||
"nodeunit": "~0.9.1" | ||
"nodeunit": "~0.11.1", | ||
"rollup": "^0.47.4", | ||
"rollup-plugin-commonjs": "^8.1.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-string": "^2.0.2" | ||
}, | ||
"preferGlobal": true | ||
"preferGlobal": true, | ||
"engines": { | ||
"node": ">= 4" | ||
} | ||
} |
@@ -40,9 +40,9 @@ # cowsay | ||
.!!!!!:. .:!!!!!!!!!!!! | ||
~~~~!!!!!!. .:!!!!!!!!!UWWW$$$ | ||
:$$NWX!!: .:!!!!!!XUWW$$$$$$$$$P | ||
$$$$$##WX!: .<!!!!UW$$$$" $$$$$$$$# | ||
$$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$* | ||
^$$$B $$$$\ $$$$$$$$$$$$ d$$R" | ||
"*$bd$$$$ '*$$$$$$$$$$$o+#" | ||
"""" """"""" | ||
~~~~!!!!!!. .:!!!!!!!!!UWWW$$$ | ||
:$$NWX!!: .:!!!!!!XUWW$$$$$$$$$P | ||
$$$$$##WX!: .<!!!!UW$$$$" $$$$$$$$# | ||
$$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$* | ||
^$$$B $$$$\ $$$$$$$$$$$$ d$$R" | ||
"*$bd$$$$ '*$$$$$$$$$$$o+#" | ||
"""" """"""" | ||
```` | ||
@@ -78,1 +78,40 @@ | ||
echo please repeat | cowsay | ||
## Usage in the browser | ||
cowsay works in your browser too with rollup / webpack / browserify / you name it. | ||
```js | ||
import { say } from 'cowsay'; | ||
console.log(say({ text: 'grazing in the browser' })); | ||
``` | ||
You can customize the cow by importing the relevant one | ||
```js | ||
import { think, SQUIRREL } from 'cowsay'; | ||
console.log(think({ | ||
text: 'grazing in the browser', | ||
cow: SQUIRREL, | ||
eyes: 'pp', | ||
tongue: ';;', | ||
})); | ||
``` | ||
All cows are included in the bundle, but you can use rollup / webpack tree-shake feature to reduce the final bundle size. | ||
### Browser options | ||
```js | ||
say({ | ||
text: 'hello', | ||
cow: '', // Template for a cow, get inspiration from `./cows` | ||
eyes: 'oo', // Select the appearance of the cow's eyes, equivalent to cowsay -e | ||
tongue: 'L|', // The tongue is configurable similarly to the eyes through -T and tongue_string, equivalent to cowsay -T | ||
wrap: false, // If it is specified, the given message will not be word-wrapped. equivalent to cowsay -n | ||
wrapLength: 40, // Specifies roughly where the message should be wrapped. equivalent to cowsay -W | ||
mode: 'b', // One of "b", "d", "g", "p", "s", "t", "w", "y" | ||
}); | ||
``` |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
94492
61
887
116
5
1