How to use the friendly-words.predicates function in friendly-words

To help you get started, we’ve selected a few friendly-words examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github processing / p5.js-web-editor / server / config / passport.js View on Github external
User.findOne({ username }, (findByUsernameErr, existingUsernameUser) => {
        if (existingUsernameUser) {
          const adj = friendlyWords.predicates[Math.floor(Math.random() * friendlyWords.predicates.length)];
          username = slugify(`${username} ${adj}`);
        }
        // what if a username is already taken from the display name too?
        // then, append a random friendly word?
        if (existingEmailUser) {
          existingEmailUser.email = existingEmailUser.email || primaryEmail;
          existingEmailUser.google = profile._json.emails[0].value;
          existingEmailUser.username = existingEmailUser.username || username;
          existingEmailUser.tokens.push({ kind: 'google', accessToken });
          existingEmailUser.name = existingEmailUser.name || profile._json.displayName;
          existingEmailUser.verified = User.EmailConfirmation.Verified;
          existingEmailUser.save((saveErr) => {
            if (saveErr) {
              console.log(saveErr);
            }
            done(null, existingEmailUser);
github processing / p5.js-web-editor / client / modules / IDE / reducers / project.js View on Github external
const generateRandomName = () => {
  const adj = friendlyWords.predicates[Math.floor(Math.random() * friendlyWords.predicates.length)];
  const obj = friendlyWords.objects[Math.floor(Math.random() * friendlyWords.objects.length)];
  return `${adj} ${obj}`;
};

friendly-words

The Glitch word list, packaged into an NPM module for easy use.

MIT
Latest version published 8 months ago

Package Health Score

70 / 100
Full package analysis

Popular friendly-words functions