Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Nov 26, 2016
1 parent 6899c2a commit 1b41e5a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,33 @@ Features:
* Generate RFC4122 version 1 or version 4 UUIDs
* Runs in node.js and browsers
* Cryptographically strong random number generation on supporting platforms
* Small footprint (Want something smaller? [Check this out](https://gist.github.com/982883) out!)
* Small footprint (Want something smaller? [Check this out](https://gist.github.com/982883)!)

## Quickstart - nodejs
## Quickstart - CommonJS (Recommended)

```shell
npm install uuid
```

```javascript
const uuid = require('uuid');
// Generate a v1 UUID (time-based)
const uuidV1 = require('uuid/v1');
uuidV1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'

// Generate a v4 (random) id
uuid() // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'

// Generate a v1 (time-based) id
uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
// Generate a v4 UUID (random)
const uuidV4 = require('uuid/v4');
uuidV4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
```

## Quickstart - browser

**Not recommende for production or even semi-production use. Use a bundling tool instead (i.e. webpack, browserify, rollup, etc)**
## Quickstart - CDN

[wzrd.in](https://github.com/jfhbrook/wzrd.in) will serve up any npm module after performing basic bundling and minification.
`browserify`-ed versions of this module can be included directly via [wzrd.in](https://github.com/jfhbrook/wzrd.in).

```html
<script src="http://wzrd.in/standalone/uuid@latest"></script>

uuid.v1(); // -> v1 UUID
uuid.v4(); // -> v4 UUID
```

## API
Expand Down

0 comments on commit 1b41e5a

Please sign in to comment.