# uid2

> strong uid

Latest version **1.0.0** (published 2021-08-25) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-08-25 |
| First published | 2013-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/uid2) |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 43 |
| Maintainers | coreh |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2021-08-25
- 0.0.4 — 2021-08-24
- 0.0.3 — 2013-07-06
- 0.0.2 — 2013-02-25
- 0.0.1 — 2013-02-04

## README

# uid2

[![NPM version](https://badge.fury.io/js/uid2.svg)](http://badge.fury.io/js/uid2)

Generate unique ids. Pass in a `length` and it returns a `string`.


## Installation

    npm install uid2

## Examples

Without a callback it is synchronous:

```js
const uid = require('uid2');

const id = uid(10);
// id => "hbswt489ts"
```

With a callback it is asynchronous:

```js
const uid = require('uid2');

uid(10, function (err, id) {
  if (err) throw err;
  // id => "hbswt489ts"
});
```

Imported via `uid2/promises` it returns a `Promise`:

```js
const uid = require('uid2/promises');

async function foo() {
  const id = await uid(10);
  // id => "hbswt489ts"
}
```

## License

MIT

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