Skip to content

An npm package that allows you to generate Nigerian data like names, banks, emails, states and more.

Notifications You must be signed in to change notification settings

mayankbucha/naija-faker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

naija-faker

This package helps you generate Nigerian data on the fly for use in your projects.

Getting Started

To get started, follow the instructions below

  • install the package npm install naija-faker
  • import it in your app using either of:
 import naijaFaker from 'naija-faker // if using ES6

 const naijaFaker = require('naija-faker)
  • use it! naijaFaker.getFirstName()

Available methods

Generate an array of people with first name, last name, age, bank and state

  • To generate an array of people, simply pass an amt value to getPerson() i.e getPersonList({amt: 2})
  • NB: Default amt is 5

 getPersonList({amt: 2})
  =>
  [
    {fName: 'abdul', lName: 'qadr', age: 40, email: 'abdul.qadr@hey.com', state:'ekiti' },
    {fName: 'frank', lName: 'edoho', age: 23, email: 'frank.edoho@gmail.com', state:'delta' }
  ]`

Generate a random First name or Last name

  • getFirstName() //=> 'abraham'
  • getLastName() //=> 'fatai

Generate a random First name or Last name that starts with a specific letter

  • NB: Currently only accepts one letter

  • getFirstName('r') //=> 'rahman'

  • getLastName('b') //=> 'bolanle'

Generate a person Object with random values for First name, Last name and Age

  • NB: Default age is between 18 - 50
 getPerson()
  //=> {fName: 'abdul', lName: 'qadr', age: 20, email: 'abdul.qadr@hey.com', state:'ekiti' }

-- To change the default `min` and `max` values for age, pass in min and max values as an object like below.

- e.g: ```
  getPerson({min:20, max:50})
  => {
    fName: 'abdul', lName: 'qadr', age: 40,
    email: 'abdul.qadr@hey.com', state:'ekiti', bank:'Access bank'
    }

Generate an array of only names

  • Simply pass amt to getNameList() e.g

    NB: Default amt is 5

getNameList({amt: 5})

Generate a random Nigerian state

  • Simply call getState() //=> 'Ondo'

Generate a bank name

  • Simply call getBank() //=> 'Access Bank'

Authors

👤 Adebola Adeniran

🤝 Contributing

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

📝 License

This project is MIT licensed.


About

An npm package that allows you to generate Nigerian data like names, banks, emails, states and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%