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

modnarjs

v1.1.6

Published

Use to generate fake data for your project

Downloads

22

Readme

Installation

npm i modnarjs

Getting started

const modnarjs = require("modnarjs");
// or
import modnarjs from "modnarjs";

Name

config

you can change default array of first & last name. only if you need to change default config!

modnarjs.name.config(data: {
  F_NAME?: string[]; // female names
  M_NAME?: string[]; // male names
  LAST_NAME?: string[]; // last names
}): void
// e.g.
name.config({ LAST_NAME: ["bashi", "espinal", "blackwall"] })

fName

Random male or female first name

modnarjs.name.fName(data?: {
    name?: string;
    gender?: string;
    start?: string;
    end?: string;
}): string
// e.g.
modnarjs.name.fName() // "sam"

lName

Random last name

modnarjs.name.lName(data?: {
    name?: string,
    start?: string,
    end?: string
}): string
// e.g.
modnarjs.name.lName({start: "h"}) // "haggstrom"

Prefix

Random prefix

modnarjs.name.prefix(
    gender?: string
): string
// e.g.
modnarjs.name.prefix("male") // "Mr."

Date

day

Random day

modnarjs.date.day(): string
// e.g.
modnarjs.date.day() // "Monday"

month

Random month

modnarjs.date.month(): string
// e.g.
modnarjs.date.month() // "February"

Animal

kind

Random animal kind

modnarjs.animal.kind(): string
// e.g.
modnarjs.animal.kind() // "dog"

Color

color

Random colors (rgb,rgba,hex) - formats (default is "rgb")

modnarjs.color.color(format?: string): number[] | undefined | string
// e.g.
modnarjs.color.color('hex') // "1e1e1e"

Phone

phone

Random phone number with your own format

modnarjs.phone.phone(format?: string): string
// e.g.
modnarjs.phone.phone("### ### - ###") // "123 645 - 123"
modnarjs.phone.phone() // "+1 645 123 4343"

Lorem

config

you can change config for default 'sentences per paragraph' and 'words per sentence'

modnarjs.lorem.config(data: {
  WPS?: { // words per sentence
    min?: number; // default is 4
    max?: number; // default is 16
  };
  SPP?: { // sentences per paragraph
    min?: number; // default is 4
    max?: number; // default is 8
  }
}): void

sentences

Random sentence, you can change default words per sentence

modnarjs.lorem.sentences(sentences: number): string
// e.g.
modnarjs.lorem.sentences(1) // "relaxing delphi trophy emotion buick."

paragraphs

Random paragraph, you can change default sentences per paragraph

modnarjs.lorem.paragraphs(paragraphs: number): string
// e.g.
modnarjs.lorem.paragraphs(5)

Credit Card

All credit card numbers are valid with luhn algorithm

visaCard

Random visa card info

modnarjs.card.visaCard(): I_Card_Visa
// e.g.
modnarjs.card.visaCard()
/*
{
  name: "Visa",
  creditNumber: 4775876705860201,
  cvv: 712,
  holder: 'WENDELL CMIEL',
  expire: '15/24'
}
*/

masterCard

Random master card info

modnarjs.card.masterCard(): I_Card_Visa

amexCard

Random amex card info

modnarjs.card.amexCard(): I_Card_Visa

isValid (luhn algorithm)

modnarjs.card.isValid(creaditCardNumber: string): I_Card_Visa_Valid
// e.g.
modnarjs.card.isValid("4775876705860201")
/*
{
  isValid: true,
  checksum: undefined
}
*/

Net

email

Random email

modnarjs.net.email(data?: {
  firstName?: string,
  lastName?: string,
  company?: string, // e.g. "gmail.com"
}): string
// e.g.
modnarjs.net.email() // "[email protected]"

ipv4

Random ipv4 - Class types "A","B","C","D","E"

modnarjs.net.ipv4(classType?: string): string
// e.g.
modnarjs.net.ipv4("A") // "42.29.140.187"
modnarjs.net.ipv4() // "164.198.12.127"

domain

Random top-level domain with 1487 top-level domains

modnarjs.net.domain(): string
// e.g.
modnarjs.net.domain() // "com"

Country

country

Random country name

modnarjs.country.country(): string
// e.g.
modnarjs.country.country() // "Egypt"

Number

float

Random float number

modnarjs.number.float(data?: {
  min?: number;
  max?: number;
  decimal?: number;
}): number
// e.g.
modnarjs.number.float({ min: 1, max: 1000 }) // 206.77

int

Random int number

modnarjs.number.int(data?: {
  min?: number;
  max?: number;
}): number
// e.g.
modnarjs.number.int() // 10

array

Random int or float array number, type and length can not be undefined.

modnarjs.number.array(data: {
  min?: number;
  max?: number;
  decimal?: number;
  type: string; // "int" or "float"
  length: number;
}): number[]
// e.g.
modnarjs.number.array({length:5,type:'int'}) // [ 606, 218, 787, 480, 340 ]