piuccio / cowsay Goto Github PK
View Code? Open in Web Editor NEWcowsay is a configurable talking cow
License: Other
cowsay is a configurable talking cow
License: Other
The space between the << and the EOC causes a problem with the IBM cow.
https://github.com/piuccio/cowsay/blob/master/cows/ibm.cow#L5
replace << EOC
with <<EOC
To reproduce error:
cowsay -f ibm anyMessageYouWantReally
I have been wanting to use cowsay
in the web browser for awhile now. There is a fork of this package makes it work, but the docs are not good, and it seems to me that it would be better to make it work on the upstream version.
I was wondering if you would be willing to accept a patch that refactors the loading of the cows to not use any node apis? I was thinking of converting the cow files into json, and writing a build script to convert the original versions to json versions. Should be relatively easy and work seamlessly on both Node.js and in the browser with something like Webpack or Browserify. Creating UMD bundles would also be a possibility.
The original cowsay
supports piping input as well as accepting it on the command line. For example:
$> fortune | cowsay
_____________________________________
< Captain's Log, star date 21:34.5... >
-------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
But npm cowsay
does not seem to accept input from a pipe. Any hope of / interest in that? Thanks for keeping the old classics alive. ;)
it would be great to have a Clippy added as one of the options.
You can see the border is too small for the entire message. Looks like it was sized according to the first line, not the widest line. (COLUMNS is 148 so I doubt that matters). I've confirmed same issue with other fortunes, on the author's line. Is it possible the author's line is indented with tab(s), and cowsay doesn't take tab width into account?
# fortune | cowsay -W $COLUMNS
_______________________
/ I am two with nature. \
\ -- Woody Allen /
-----------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
why did you do that?
I use you library as demo for jQuery Terminal and it seems that it don't wrap word properly,
type this:
echo There is in the worst of fortunes the best change of a happy ending. | say
the output is:
__________________________________________
/ There is in the worst of fortunes the be \
\ st change of a happy ending. /
------------------------------------------
\ ^__^
\ (oO)\_______
(__)\ )\/\
||----w |
|| ||
but native cowsay prints:
_______________________________________
/ There is in the worst of fortunes the \
\ best change of a happy ending. /
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
As you can see best is never broken into two words. If you will accept PR I can check if I can fix this.
I get this error:
env: node\r: No such file or directory
Node version: v0.10.5
Running on a mac.
As lovely as stegosaurus is, it's missing its signature tail spikes. For the sake of palaentological accuracy they would be a welcome addition.
Can you please add an option to make cowsay select a random cowfile every time? I think it would be fun in conjunction with fortune.
I used it in typescript
, can the author write index.d.ts
for this library, thank you!
With npx you don't have to have the module installed directly on your computer. So you can do something like:
npx cowsay Hello!
But, this doesn't work:
npx cowthink Hello!
Is this because npx runs the module name cowsay and just runs the first command it finds in the "bin" field in package.json? Is there a way to run cowthink
directly from npx as it is or with some code changes to the module?
This is relevant to me as I'm using your module to teach myself how to create node cli modules and would be interested in running multiple cli commands from a module invoked directly via npm remote calls.
Hi,
I'm new to node and am trying to build cowsay
in the browser using browserify
. I'm encountering this error:
$ browserify clientCowsay.js -o bundle.js
Error: Cannot find module '.cows/ackbar.cow' from '/my/dev/dir/node_modules/cowsay/build'
I've installed browserify
to system, cowsay
locally, and am using this JavaScript:
// clientCowsay.js
const cowsay = require('cowsay');
console.log(cowsay.say({text: "You don't say!"}));
Am I making a mistake or is there something out of sorts with the package?
Thanks!
The dependency strip-eof has been renamed to strip-final-newline. The API does not change.
Why was the mutilated cow removed? Eating a hamburger is probably more offensive.
Hi.
/cows/mech-and-cow
missing .cow
.
According to npm audit, there is currently a vulnerability to minimist versions <0.2.1. The version of optimist being declared as a dependency is no longer maintained and calls for a very old version of minimist. Suggest to switch to minimist as the optimist dev suggests or switch to https://github.com/chevex/yargs
Can you tag a release please so we can package it for Solus?
I was a little confused by all the complexity going on with how .cow files are imported, and not really understanding why there's different documentation for browser usage and NodeJS usage. And I had issues with Webpack bundling, so I ended up largely rewriting your cowsay
as a fork. It's pretty nice because it has all the cows just as JS modules and there's no filesystem reading.
Curious what you think? Your cowsay is 7 years old? Javascript has come a long way since then!
The mech-and-cow.cow file is not properly formatted and generates errors when used as cowsay -f mech-and-cow something
One of the examples shows:
cowsay.say({
text : "I'm a moooodule",
e : "oO",
T : "U "
})
which does't work (eyes and tongue don't change), other example says:
console.log(think({
text: 'grazing in the browser',
cow: SQUIRREL,
eyes: 'pp',
tongue: ';;',
}));
that API works.
My first attempt was to use the default export... default exports are widespread, but controversial, so fine. Then I saw the real default export is say... okay, so I passed a string to it... no cigar.
On a Migration to typescript, this should be rolled in.
> require('cowsay').say('JavaScript FTW!')
Uncaught TypeError: Cannot read property 'join' of undefined
at doIt (/sandbox/node_modules/cowsay/index.js:149:51)
at Object.exports.say (/sandbox/node_modules/cowsay/index.js:57:9)
> require('cowsay').say({ text: 'JavaScript FTW!' })
' _________________\n' +
'< JavaScript FTW! >\n' +
' -----------------\n' +
' \\ ^__^\n' +
' \\ (oo)\\_______\n' +
' (__)\\ )\\/\\\n' +
' ||----w |\n' +
' || ||'
>
I have a Javascript project that's compiled with Webpack/Babel for use in NodeJS runtime, and when I try to depend on cowsay
I get this error at compile time:
[node] Error: Cannot find module '.cows/ackbar.cow'
[node] at webpackMissingModule (webpack:///./node_modules/cowsay/build/cowsay.es.js?:50:45)
[node] at eval (webpack:///./node_modules/cowsay/build/cowsay.es.js?:50:136)
[node] at Module../node_modules/cowsay/build/cowsay.es.js (/local/home/simnsj/workspace/nodetemplate/src/NodeStarterTemplate/dist/server/main.js:782:1)
...
My code for including cowsay looks something like this:
import cowsay from 'cowsay';
class Cowsay extends React.Component {
render() {
return <div>{cowsay.say({text: this.props.children})}</div>;
}
}
I don't understand javascript modules that well, and I think they're a moving target...
When reading piped input, cowsay -n
prints a trailing newline. This behavior doesn't exist in the original perl version:
$ # perl
$ echo 'test' | /opt/local/bin/cowsay -n
______
< test >
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
$ # javascript
$ echo 'test' | ~/n/bin/cowsay -n
______
/ test \
\ /
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Hi,
I am trying to use the cowsay
with typescript and npm but I can't find the proper @types
to install.
the results from npm search @types/cowsay
are No matches found for "@types/cowsay"
.
The error i am receivign when i am trying to use.
TSError: ⨯ Unable to compile TypeScript:
src/scrape/index.ts:5:25 - error TS7016: Could not find a declaration file for module 'cowsay'.
'whatever-my-root-folder-is/node_modules/cowsay/index.js' implicitly has an 'any' type.
Try `npm install @types/cowsay` if it exists or add a new declaration (.d.ts) file containing `declare module 'cowsay';`
5 import * as cowsay from 'cowsay';
any ideas? Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.