Coder Social home page Coder Social logo

onedebos / naija-faker Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 3.0 183 KB

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

Home Page: https://github.com/onedebos/naija-faker

JavaScript 100.00%
naija-faker nigerian-banks nigerian-states nigerian-names nigerian-data nigerian-faker

naija-faker's Introduction

release issues forks stars Maintenance ci test test test test

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 package npm install naija-faker
  • import it in your app using:
// if using ES6
import naijaFaker from "naija-faker";

// or

import {
  getFirstName,
  getLastName,
  getPerson,
  getPersonList,
  getNameList,
  getBank,
  getState,
  getPhoneNumber,
  getAddress,
} from "naija-faker";

// without ES6
const naijaFaker = 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 an amt value to getPersonList() i.e getPersonList({amt: 2})
  • NB: Default amt is 5
getPersonList({ amt: 2 });
//outputs:
[
  {
    fName: "abdul",
    lName: "qadr",
    age: 40,
    email: "[email protected]",
    state: "ekiti",
    phoneNumber: "+234-805-940-4016",
    address: "102b, opebi road, opebi, abakaliki",
  },
  {
    fName: "frank",
    lName: "edoho",
    age: 23,
    email: "[email protected]",
    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: '[email protected]', state:'ekiti',
      phoneNumber:'+234-805-940-4016', address: 'plaza 1121, odunuga street, igboho'
    }
  • To change the default min and max 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: '[email protected]', 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 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'

Generate an address

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

Generate a phone number

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

Test

  • To run the tests
npm install
npm test

Authors

๐Ÿ‘ค Adebola Adeniran

๐Ÿค Contributors

๐Ÿ‘ค Mayank Bucha

๐Ÿ‘ค Nikhil Chaurasia

Show your support

Give a โญ๏ธ if you like this project!

Acknowledgments

๐Ÿ“ License

This project is MIT licensed.

naija-faker's People

Contributors

mayankbucha avatar nikhil-chaurasia14 avatar onedebos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

naija-faker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.