# coughy

> Placing the Underscore project into the Global Namespace.

Latest version **0.0.1** (published 2013-11-04) · BSD license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2013-11-04 |
| First published | 2013-11-04 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Howard Abrams |
| Maintainers | howardabrams |
| Keywords | coffee, coffeescript, functional |

## Links

- npm: https://www.npmjs.com/package/coughy
- Repository: http://github.com/howardabrams/coughy
- Issues: https://github.com/howardabrams/coughy/issues
- npm.io page: https://npm.io/package/coughy

## Dependencies (3)

- [mori](https://npm.io/package/mori.md) latest
- [underscore](https://npm.io/package/underscore.md) >= 1.5.2
- [coffee-script](https://npm.io/package/coffee-script.md) >= 1.6.3

## Recent versions

- 0.0.1 (latest) — 2013-11-04

## README

Why Coughy? Well, CoffeeScript gives JavaScript a much more palatable
syntax. Of course, each of your projects include the lovely [[http://underscorejs.org/][Underscore]]
library, however, pre-pending =_.= makes your code look crummy.

Coughy is <ahem> quite wrong in that it places the Underscore library
into the global name space. /WHAT!?/ Yes. Just look at this beautiful
code:

#+BEGIN_SRC coffee
  # Sum the squares that are less than 25... right, it is 30.
  reduce( map( range(5), (x) -> x * x ),
          (total, cur) -> total + cur )
#+END_SRC

Why do this? This certainly isn't for everyone, or every project, but
for working on [[http://projecteuler.net/][Project Euler]], or teaching programming concepts, this
seems like <cough> an acceptable solution.

** Installation

   As usual, you can take advantage of this project by adding this to
   your normal Node-related project:

#+BEGIN_SRC sh
npm install coughy
#+END_SRC

   Now, you can create scripts that use those functions directly:

#+BEGIN_SRC js
require('coughy');
#+END_SRC

   *Note:* You do not need to assign the results of the coughy module
   *because <ahem>, it is already <cough> placed in the global namespace.

** REPL Sweetness

   By using the [[http://danielgtaylor.github.io/nesh/][Nesh project]], we can make pre-load /coughy/ in order to
   make a better REPL:

#+BEGIN_SRC sh
  npm install -g nesh
#+END_SRC

   Then, create a Shell function like this:

#+BEGIN_SRC sh
  nesh --lang coffee --eval 'node_modules/coughy/coughy.js'
#+END_SRC

   Where =coughy.js= needs to be the filename to the magic <ahem> script
   that provides this pleasing abomination.

** Futures

   *Think of this...* An even more functional approach to development
   is with something like the immutable data structures available from
   [[http://swannodette.github.io/mori/][Mori]] ... However, since Mori's functions overlap with Underscore
   (but seem to be more general), I may just swap it.

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