By: Yim Sotharoth
firstly create a node project
I named my folder as uuid so I cd in my folder
In uuid folder I install uuid library with the following command
In index.js I generated a uuidv4 like this:
This is the result I got from the console.log
uuidv4: 86d24ae5-ac1d-4753-94a0-a6d2b5a43246
I created a folder called 'helpers'
In 'helpers' I created a file called uuidValidator.js with the following code:
This function will return boolean
In 'helpers' I created a file called uuidVersionChecker.js with the following code:
This function will return the version of the uuid if the input is a uuid and will return 'Not a uuid' if it's not a uuid
In 'helpers' I created a file called uuidValidateV4.js with the following code:
This function will return boolean
I tested out all the functions in index.js
Project Repository : https://github.com/metaphorlism/npm-libraries/tree/npm-uuid