- Notifications
You must be signed in to change notification settings - Fork4
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
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This package helps you generate fake Nigerian data on the fly for use in your projects.
To get started, follow the instructions below
- install the package
npm 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();
- To generate an array of people, simply pass an
amt
value togetPersonList()
i.egetPersonList({amt: 2})
- NB: Default
amt
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",},];
getFirstName() //=> 'abraham'
getLastName() //=> 'fatai'
getFirstName('r') //=> 'rahman'
getLastName('bo') //=> 'bolanle'
- 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 default
min
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'}
Simply pass
amt
togetNameList()
e.gNB: Default
amt
is 5
getNameList({amt:5});
- Simply call
getState() //=> 'Ondo'
- Simply call
getBank() //=> 'Access Bank'
- Simply call
getAddress() //=> 'Plot 83, Nasarawa, Bauchi'
- Simply call
getPhoneNumber() //=> '+234-805-940-4016'
- To run the tests
npm installnpm test
👤Adebola Adeniran
- Github:@githubhandle
- Twitter:@twitterhandle
- Linkedin:linkedin
- Web:Adebola
👤Mayank Bucha
- Github:@githubhandle
- Linkedin:linkedin
- Email:gmail
👤Nikhil Chaurasia
Give a ⭐️ if you like this project!
This project isMIT licensed.
About
An npm package that allows you to generate Nigerian data like names, banks, emails, states and more.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.