Giter Club home page Giter Club logo

cowsay's People

Contributors

andrialexandrou avatar balping avatar benhassara avatar dependabot[bot] avatar dissem avatar doug2k1 avatar fentie avatar freshlogic avatar frontcodelover avatar gene-pavlovsky avatar iarmankarimi avatar jasonkhanlar avatar jorenbroekema avatar liljencrantz avatar lukebatchelor avatar mariolamacchia avatar nikovirtala avatar piuccio avatar ricksbrown avatar tvdstaaij avatar zolaemil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cowsay's Issues

[FR] Support string as a parameter to say

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' +
  '                ||     ||'
>

add clippy

it would be great to have a Clippy added as one of the options.

Random cowfile option

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.

`cowsay -n` adds trailing newline when input is piped

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 |
                ||     ||

Wrong example in README

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.

Word wrap

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.

Module issues with Webpack

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...

why?

why did you do that?

Browserify fails to build

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!

Error running cowsay

I get this error:

env: node\r: No such file or directory

Node version: v0.10.5
Running on a mac.

Border formatting problem

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 |
                ||     ||

Make web pack compatible.

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.

Pipe input to cowsay?

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. ;)

Introducing a fork

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!

https://github.com/johnnysprinkles/cowsay

Vulnerability found in minimist

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

Is there a way to run cowthink directly via npx

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.

typescript support

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!

Tag a release

Can you tag a release please so we can package it for Solus?

Add thagomizers to stegosaurus

As lovely as stegosaurus is, it's missing its signature tail spikes. For the sake of palaentological accuracy they would be a welcome addition.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.