# wadofgum-uuid

> a UUID generator for wadofgum models

Latest version **1.0.0** (published 2015-10-10) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2015-10-10 |
| First published | 2015-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nathan LaFreniere |
| Maintainers | nlf |
| Keywords | wadofgum |

## Links

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

## Dependencies (2)

- [joi](https://npm.io/package/joi.md) ^6.9.0
- [uuid](https://npm.io/package/uuid.md) ^2.0.1

## Recent versions

- 1.0.0 (latest) — 2015-10-10
- 1.0.0-beta1 — 2015-02-07

## README

## wadofgum-uuid [![Build Status](https://travis-ci.org/nlf/wadofgum-uuid.svg)](https://travis-ci.org/nlf/wadofgum-uuid)

A mixin to make sure your models have an 'id' field configured to be a uuid string. This mixin does nothing if you don't have a validation mixin loaded.

###

When using this mixin an `id` property will be added to your class schema and defined as `Joi.string().guid()`. When calling validate if the instance's `id` property is blank, a uuid will be assigned for you.

```js
const Wadofgum = require('wadofgum');
const Validation = require('wadofgum-validation');
const UUID = require('wadofgum-uuid');
const Joi = require('joi');

class Model extends Wadofgum.mixin(Validation, UUID) {};
Model.schema = { name: Joi.string() };

let model = new Model({ name: 'test' });
model.id; // undefined
model.validate().then(function () {
  model.id; // some randomly generated uuid
});

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