# names

> Minimal API client for uinames.com

Latest version **1.0.0** (published 2016-06-26) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.0 |
| Published | 2016-06-26 |
| First published | 2012-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | leo |
| Maintainers | leo |
| Keywords | uinames, names, random, generator, name |

## Links

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

## Dependencies (1)

- [request-promise](https://npm.io/package/request-promise.md) ^3.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-06-26
- 0.1.0 — 2016-02-22
- 0.0.2 — 2012-10-05
- 0.0.1 — 2012-10-05

## README

# names [![Build Status](https://travis-ci.org/leo/names.svg?branch=master)](https://travis-ci.org/leo/names)

This package acts as an API client for my favorite generator of random names: [uinames](http://uinames.com). It's perfect for prototyping stuff or examples of real names in production apps.

## Usage

Install the package using [npm](https://www.npmjs.com) and save it to the dependency list:

```bash
npm install --save names
```

Now you have two choices to interact with the package. Since it's based on the concept of [promises](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise), you can either use async/await (it hasn't yet landed in node, so you'll have to [transpile](https://gist.github.com/rauchg/8199de60db48026a6670620a1c33b700) the code)...

```js
import names from 'names'

try {
  const list = await names()
} catch (err) {
  console.error(err)
}
```

...or the old way of doing it:

```js
const names = require('names')()

names.then(function (list) {
  console.log(list)
})

names.catch(function (err) {
  console.error(err)
})
```

Both examples will result in a response that looks like the following:

```json
{
  "name": "John",
  "surname": "Doe",
  "gender": "male",
  "region": "United States"
}
```

## Configuration

Indipendent from which of the methods mentioned above you would like to use, you can always pass a configuration object to the module's main method:

```js
names({
  gender: 'female',
  amount: 10
  ...
})
```

Here's the full list of all available options:

| Name | Description | Type |
| ---- | ----------- | ---- |
| amount | Amount of names to return, between `1` and `500` | Integer |
| gender | Limit results to the `male` or `female` gender | String |
| region | Region-specific results | String |
| minLength | Require a minimum number of characters in a name | Integer |
| maxLength | Require a maximum number of characters in a name | Integer |

## Contribute

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Transpile the source code and watch for changes: `npm start`
4. Within the module you want to test your local development instance of names, just link it to the dependencies: `npm link names`. Instead of the default one from npm, node will now use your clone of names!

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