You also need to install:
- Node 10+
- python
- g++
- and make
For more details see node-gyp
$ npm i fast-uuidv4
$ yarn add fast-uuidv4
const { uuidV4 } = require('fast-uuidv4');
const uuid = uuidV4()
console.log(uuid) // c6bc3d9f-3e2c-4170-99e7-b9809f229ecb
- uuid => https://www.npmjs.com/package/uuid
- crypto nodejs => Nodejs Vanilla
- fast-uuidv4 => This package
name | result |
---|---|
uuid | x 118,166 ops/sec ±5.24% (63 runs sampled) |
crypto nodejs | x 129,021 ops/sec ±0.81% (55 runs sampled) |
fast-uuidv4 | x 175,673 ops/sec ±15.86% (29 runs sampled) |
$ git clone https://github.com/z22092/fast-uuidv4.git & cd fast-uuidv4/benchmarks
$ npm i & npm start