Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

NotificationsYou must be signed in to change notification settings

onedebos/naija-faker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

releaseissuesforksstarsMaintenancecitesttesttesttest

naija-faker

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

See it on NPM

Getting Started

To get started, follow the instructions below

  • install the packagenpm install naija-faker
  • import it in your app using:
// if using ES6importnaijaFakerfrom"naija-faker";// orimport{getFirstName,getLastName,getPerson,getPersonList,getNameList,getBank,getState,getPhoneNumber,getAddress,}from"naija-faker";// without ES6constnaijaFaker=require("naija-faker");
  • use it!
naijaFaker.getFirstName();

Available methods

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

  • To generate an array of people, simply pass anamt value togetPersonList() i.egetPersonList({amt: 2})
  • NB: Defaultamt is 5
getPersonList({amt:2});//outputs:[{fName:"abdul",lName:"qadr",age:40,email:"abdul.qadr@hey.com",state:"ekiti",phoneNumber:"+234-805-940-4016",address:"102b, opebi road, opebi, abakaliki",},{fName:"frank",lName:"edoho",age:23,email:"frank.edoho@gmail.com",state:"delta",phoneNumber:"+234-705-261-5977",address:"223, ambeez plaza, zone 5, onne",},];

Generate a random First name or Last name

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

Generate a random First name or Last name that starts with a letter/letters

  • getFirstName('r') //=> 'rahman'
  • getLastName('bo') //=> 'bolanle'

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

  • NB: Default age is between 18 - 50
getPerson();// outputs:{fName:'abdul',lName:'qadr',age:20,email:'abdul.qadr@hey.com',state:'ekiti',phoneNumber:'+234-805-940-4016',address:'plaza 1121, odunuga street, igboho'}
  • To change the defaultmin andmax values for age, pass in min and max values as an object like below.
getPerson({min:20,max:50});// outputs:{fName:'abdul',lName:'qadr',age:40,email:'abdul.qadr@hey.com',state:'ekiti',bank:'Access bank',phoneNumber:'+234-805-940-4016',networkProvider:'Globacom',address:'9329, stanton oval, kwara, kosofe'}

Generate an array of only names

  • Simply passamt togetNameList() e.g

    NB: Defaultamt is 5

getNameList({amt:5});

Generate a random Nigerian state

  • Simply callgetState() //=> 'Ondo'

Generate a bank name

  • Simply callgetBank() //=> 'Access Bank'

Generate an address

  • Simply callgetAddress() //=> 'Plot 83, Nasarawa, Bauchi'

Generate a phone number

  • Simply callgetPhoneNumber() //=> '+234-805-940-4016'

Test

  • To run the tests
npm installnpm test

Authors

👤Adebola Adeniran

🤝 Contributors

👤Mayank Bucha

👤Nikhil Chaurasia

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

📝 License

This project isMIT licensed.


[8]ページ先頭

©2009-2025 Movatter.jp