Skip to content

Onetail/automatic-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

automatic-name

How to install

yarn add automatic-name

or

npm install automatic-name

Feature

Create new name

createNewName(language1, language2 ...)

language arguments

  • taiwan
  • chinese
  • english

It will be selected a random language without any arguments.

Get firstname and lastname middle spacing

getSpacing()

Set firstname and lastname middle spacing

setSpacing(string)

Get tag string

getTag()

Set tag string

setTag(string)

Get username

getUsername()

Get fullname

getFullName(option)

option argument

  • option [color=#2a1377](mean: 'spacing', type: 'string')

Get username with Tag

getUsernameWithTag(type [,options])

Get fullname with Tag

getFullnameWithTag(type [,options]) type argument

  • type [color=#2a1fff](mean: 'random type', type: 'string')
    • number (mean: 'random number')
    • timestamp (mean: 'Date.now()')
    • v* (mean: 'uuid extension for uuid library: uuid')

params arguments

  • if type = number, params argument 1 is random count

    default 4

  • uuid extension arguments

Example

const AutomaticName = require('automatic-name');

const name = new AutomaticName();

(async () => {
  name.getUsername();
  // RobertsHolly

  name.getFullname();
  // Roberts Holly

  await name.getUsernameWithTag('v1');
  // RobertsHolly#c39404b1-8170-11eb-9eea-774c26920ecf

  name.createNewName();
  // random a new name
})();