How to use shortid

Comprehensive shortid code examples:

How to use shortid.seed:

3
4
5
6
7
8
9
10
11
12
13
/**
 * Make any changes you need to make to the database here
 */
async function up () {
  try {
    shortid.seed(Math.random())
    let users = await user.model.find()


    await Promise.all(users.map(async user => {
      if (!user.id) {

How to use shortid.generate:

879
880
881
882
883
884
885
886
887
888
if (!(_NAMED !== null && _NAMED.hasOwnProperty('mapping'))) {
  const codeStr = this.$$mangleCode(/*await*/ nqp.arg_s(ctx, code));
  return fromJSToReturnValue(ctx, /*await*/ eval('(function() {' + codeStr + '})()'));
}

const fakeFilename = 'nqpEval' + shortid.generate();

const codeStr = this.$$mangleCode(/*await*/ nqp.toStr(code, ctx));

// TODO - get rid of the node.js specific way