# codename

> Codename generator

Latest version **0.0.6** (published 2018-10-25) · WTFPL license · 0 weekly downloads

## Install

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

Provides the command `codename`.

## 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.6 |
| Published | 2018-10-25 |
| First published | 2014-01-27 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | RJ Zaworski |
| Maintainers | rjz |

## Links

- npm: https://www.npmjs.com/package/codename
- Repository: https://github.com/rjz/codename
- Homepage: https://github.com/rjz/codename#readme
- Issues: https://github.com/rjz/codename/issues
- npm.io page: https://npm.io/package/codename

## Dependencies (3)

- [async](https://npm.io/package/async.md) ~0.2.9
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [optimist](https://npm.io/package/optimist.md) 0.3.7

## Recent versions

- 0.0.6 (latest) — 2018-10-25
- 0.0.5 — 2018-10-20
- 0.0.4 — 2015-08-01
- 0.0.3 — 2014-02-24
- 0.0.2 — 2014-02-02
- 0.0.1 — 2014-01-27

## README

# Codename generator

Generates codenames. What for, you ask?

## Installation

    $ npm install -g codename

## Usage

From node,

    var codename = require('codename')();

    var filters = ['alliterative', 'random'],
        lists = ['crayons', 'adjectives', 'cities', 'animals'],
        myName = codename.generate(filters, lists);

#### Options

`codename.generate` takes two options: `filters` and `lists`.

  * `filters` (`Array[String|Function]`) - describes a set of filters
    that should be used to reduce each list to a single word

  * `lists` - (`Array[String|Array]`) - the names or contents of the lists
    to use for selecting names

#### From the CLI,

All arguments are forwarded from comma-delimited strings:

    $ codename \
      --lists=crayons,adjectives,cities,animals \
      --filters=alliterative,unique,random

### Writing Filters

Each filter takes a `memo` listing any other words selected followed by
the list of words the filter should be applied to. For instance, a filter
to limit results to words containing the letter `j`:

    var letterJFilter = function (memo, words) {
      return words.filter(function (w) {
        return w.toLowerCase().indexOf('j') > -1;
      });
    };

Alternatively, a filter may return a *single* word that should be added to
the name. These filters are `output` filters, and they should only be used
at the end of a filter list.

Filters may be contributed to `src/filters` or supplied as function arguments to `codename.generate`.

### Word Lists

  * Adjectives from http://www.keepandshare.com/doc/12894/adjective-list
  * Animals from http://en.wikipedia.org/wiki/Lists_of_animals
  * Cities from http://answers.google.com/answers/threadview?id=596822
  * Crayons from http://www.colourlovers.com/web/blog/2008/04/22/all-120-crayon-names-color-codes-and-fun-facts

### License

  * word lists (c) their respective authors
  * codename released under the WTFPL

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