# unqid

> Generate a unique id with optional suffix

Latest version **1.0.1** (published 2016-05-01) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2016-05-01 |
| First published | 2016-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vikram Jadhav |
| Maintainers | vikramcse |
| Keywords | unique, id, generate, sequential |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-05-01
- 1.0.0 — 2016-04-28

## README

# unqid
Generate a unique id with optional prefix

## Install

```sh
$ npm install --save unqid
```

## Example

```js
var unqid = require('unqid');
console.log(unqid('sample_'));

// -> sample_1

console.log(unqid('sample_'));
console.log(unqid('sample_'));
console.log(unqid('sample_'));

// ->
//  sample_2
// sample_3
// sample_4

console.log(unqid());
console.log(unqid());
// ->
//  1
// 2
```

### `require('unqid')(prefix)`

**Arguments**:

- `prefix`: It's an string with prefix value to be attached to each unique value
- The prefix option can be optional, in this case it will generate sequential ids

**Returns**: Returns a string which is unique id throughout the context

## License

&copy; 2016 Vikram Jadhav. MIT License

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