Toggle menu

uuid

Generates version 1, 3, 4 and 5 rfc4122 UUIDs.

This library is distributed under the MIT license, its source and full documentation can be found at https://www.npmjs.com/package/uuid

Executed

Server-side.

Details

var uuid = require('uuid/[v1|v3|v4|v5]');

This module generates UUIDs. You must specify the version of UUID you want when you "require" the module. There's a good explanation of the supported versions on this Wikipedia article.

Example

The documentation linked to at the top of the page has examples of all of the different versions.

function( params, credentials ) {
    var uuidv1 = require("uuid/v1");
    return uuidv1();
}

{
    "jsonrpc": "2.0",
    "id": 2253,
    "result": "4426d660-86a2-11e8-9486-972663cd7025"
}

Last modified on March 10, 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon