Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { v1 as uuidv1 } from 'uuid';
function uuid(identifier){
return identifier + '-' + uuidv1();
}
uuid('user'); // ⇨ 'user-9k1teb4d-5b7d-7b2d-9bdd-2b0d7b3dcb6d'
uuid('product'); // ⇨ 'product-6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment