This library is typescript conversion of uuid-token-generator library,
To install this library
npm install ts-token-generator
import { TokenGenerator, TokenBase } from 'ts-token-generator';
const tokgen = new TokenGenerator(); // Default is a 128-bit token encoded in base58
tokgen.generate();
// -> '4QhmRwHwwrgFqXULXNtx4d'
const tokgen2 = new TokenGenerator({ bitSize: 512 baseEncoding: TokenBase.BASE62 });
// Now generate the token
tokgen2.generate();
// -> 'x6GCX3aq9hIT8gjhvO96ObYj0W5HBVTsj64eqCuVc5X'