# cowsay2

> cowsay is a configurable talking cow

Latest version **2.0.4** (published 2020-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install cowsay2
pnpm add cowsay2
yarn add cowsay2
bun add cowsay2
```

Provides the command `cowsay2`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2020-04-12 |
| First published | 2020-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 1 |
| Unpacked size | 163.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | John Simons |
| Maintainers | portersi |
| Keywords | cowsay, ASCII |

## Links

- npm: https://www.npmjs.com/package/cowsay2
- Repository: https://github.com/johnnysprinkles/cowsay
- Issues: https://github.com/johnnysprinkles/cowsay/issues
- npm.io page: https://npm.io/package/cowsay2

## Dependencies (1)

- [string-width](https://npm.io/package/string-width.md) ^4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2020-04-12
- 2.0.3 — 2020-04-06
- 2.0.2 — 2020-02-05
- 2.0.1 — 2020-01-22
- 2.0.0 — 2020-01-22

## README

# cowsay

[![Build Status](https://travis-ci.com/johnnysprinkles/cowsay.svg?branch=master)](https://travis-ci.com/johnnysprinkles/cowsay)
[![npm version](https://badge.fury.io/js/cowsay2.svg)](https://badge.fury.io/js/cowsay2)

Modernized version of cowsay

This borrows from https://github.com/piuccio/cowsay.
The cow files are the same content but instead of Perl heredoc text files
they're ES6 template literals.

* No reading files at runtime. Cows are declared as static compile-time dependencies.
* Works the same whether client-side or server-side, and whether running from
  raw source for from a transpiled bundle.
* Leveraging modern language features like destructuring and arrow functions.
* Update to more modern Javascript style with two-space indents, single quoted
  strings, and `const` and `let` instead of `var`, as you might see on the Google
  or airbnb JS style guides.

### Usage

See test/example.js for examples, but the basic usage is:

    cowsay.say('What you want to say');

Or pass some options:

    cowsay.say('Did you hear someting?', { mode: 'paranoid' });
    cowsay.say('A quick brown fox jumped over the lazy dog', { W: 15 });
    cowsay.think('I\'m looking sideways', { e: 'cc' });

Get a demo of all available cows with `node test/cows.js`, and get a demo of all
available modes with `node test/modes.js`. Get a general test demonstrating line wrapping
and whitespace handling at `node test/example.js`.

### Importing cows

The above examples use the default cow file. You can import other cows and pass them in
on the `cow` option. Do that one of two ways.

Import all cows, like:

    let cows = require('cowsay2/cows');
    cowsay('Gobble gobble', { cow: cows.turkey });

Or just import the cow you need (better for client-side bundles):

    let cow = require('cowsay2/turkey');
    cowsay('Gobble gobble', { cow });

### Text options

* `n` or `nowrap`: Don't do any line wrapping beyond whatever newlines occur in the provided text
* `W`: Number of columns to wrap at (defaults to 40)

### Examples

See some live example on RunKit at
https://runkit.com/johnnysprinkles/5e28a5470e860e001a25123f

    console.log(cowsay('hi'));
     ____
    < hi >
     ----
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||


    console.log(cowsay.say("The static String.raw() method is a tag function of template literals. This is similar to the r prefix in Python, or the @ prefix in C# for string literals. (But it is not identical; see explanations in this issue.) It's used to get the raw string form of template strings, that is, substitutions (e.g. \${foo}) are processed, but escapes (e.g. \n) are not."));
     __________________________________________
    / The static String.raw() method is a tag  \
    | function of template literals. This is   |
    | similar to the r prefix in Python, or    |
    | the @ prefix in C# for string literals.  |
    | (But it is not identical; see            |
    | explanations in this issue.) It's used   |
    | to get the raw string form of template   |
    | strings, that is, substitutions (e.g.    |
    | ${foo}) are processed, but escapes (e.g. |
    \ ) are not.                               /
     ------------------------------------------
            \   ^__^
             \  (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||


    const whale = require('./cows/whale');
    console.log(cowsay.say('Moo', { cow: whale }));
     _____
    < Moo >
     -----
       \
        \
         \
                    '-.
          .---._     \ .--'
        /       `-..__)  ,-'
       |    0           /
        --.__,   .__.,`
         `-.___'._\_.'

### Related packages

https://github.com/piuccio/cowsay

---
_Source: https://npm.io/package/cowsay2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
