npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

naija-faker

v1.3.7

Published

This package allows you to generate fake Nigerian data for use in your JavaScript projects.

Downloads

1,903

Readme

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.

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.