From 91bbec0e149fcc411686a24d7eb523c86d1b27e0 Mon Sep 17 00:00:00 2001 From: Robert Kieffer Date: Sat, 26 Nov 2016 06:38:35 -0800 Subject: [PATCH] Updated README --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index aa956345..a9466316 100644 --- a/README.md +++ b/README.md @@ -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 recommended for production or even semi-production use. Use a bundling tool instead (i.e. webpack, browserify, rollup, etc)** +## Quickstart - Pre-packaged for browsers (Not recommended) -[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 + +uuid.v1(); // -> v1 UUID +uuid.v4(); // -> v4 UUID ``` ## API