# lil-uuid

> UUID v4 generator and validator (RFC4122 compliant)

Latest version **0.1.1** (published 2015-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install lil-uuid
pnpm add lil-uuid
yarn add lil-uuid
bun add lil-uuid
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-04-30 |
| First published | 2014-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/lil-uuid) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Tomas Aparicio |
| Maintainers | h2non |
| Keywords | lil, tiny, micro, uuid, generator, v4, validator, unique, identifier, user |

## Links

- npm: https://www.npmjs.com/package/lil-uuid
- Repository: https://github.com/lil-js/uuid
- Issues: https://github.com/lil-js/uuid/issues
- npm.io page: https://npm.io/package/lil-uuid

## 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

- 0.1.1 (latest) — 2015-04-30
- 0.1.0 — 2014-09-11

## README

# [lil](http://lil-js.github.io)'-uuid [![Build Status](https://api.travis-ci.org/lil-js/uuid.svg?branch=master)][travis] [![Stories in Ready](https://badge.waffle.io/lil-js/uuid.png?label=ready&title=Ready)](https://waffle.io/lil-js/uuid) [![Code Climate](https://codeclimate.com/github/lil-js/uuid/badges/gpa.svg)](https://codeclimate.com/github/lil-js/uuid) [![Gitter chat](https://badges.gitter.im/lil-js/all.png)](https://gitter.im/lil-js/all)

<img align="center" height="150" src="http://lil-js.github.io/img/liljs-logo.png" />

UUID v4 generator and validator (RFC4122 compliant)

<table>
<tr>
<td><b>Name</b></td><td>uuid</td>
</tr>
<tr>
<td><b>Version</b></td><td>0.1.0</td>
</tr>
<tr>
<td><b>Size</b></td><td>1 KB / >1 KB (gzipped)</td>
</tr>
<tr>
<td><b>Environment</b></td><td>Browser, Node.js</td>
</tr>
</table>

## Installation

Via [Bower](http://bower.io)
```bash
bower install lil-uuid
```
Via [Component](https://github.com/componentjs/component)
```bash
component install lil-js/uuid
```

Or loading the script remotely
```html
<script src="//cdn.rawgit.com/lil-js/uuid/0.1.0/uuid.js"></script>
```

### Environments

- Node.js
- Chrome >= 5
- Firefox >= 3
- Safari >= 5
- Opera >= 10
- IE >= 9

### Usage

You could fetch de module via `require()` if it's available.
Otherwise, global fallback will be used, exposed via `lil.uuid`

##### Generate an UUID v4 schema
```js
lil.uuid()
// -> f47ac10b-58cc-4372-a567-0e02b2c3d479
```

##### Validate an UUID schema (it support multiple versions)
```js
lil.isUUID('f47ac10b-58cc-4372-a567-0e02b2c3d479')
// -> true
```

## API

#### uuid()
Return: `string`

Generate a random UUID

#### isUUID(str, [version])
Return: `boolean`

Check if a given `string` has a valid UUID format.
It supports multiple version (3, 4 and 5)

#### uuid.VERSION

## Contributing

Wanna help? Cool! It will be appreciated :)

You must add new test cases for any new feature or refactor you do,
always following the same design/code patterns that already exist

### Development

Only [node.js](http://nodejs.org) is required for development

Clone the repository
```bash
$ git clone https://github.com/lil-js/uuid.git && cd uuid
```

Install dependencies
```bash
$ npm install
```

Generate browser bundle source
```bash
$ make browser
```

Run tests
```bash
$ make test
```

## License

[MIT](http://opensource.org/licenses/MIT) © Tomas Aparicio

[travis]: http://travis-ci.org/lil-js/uuid

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