Skip to content

Nothing to see here. Just a trial package to test pkg publishing in npm and jsr.

License

Notifications You must be signed in to change notification settings

preyan/rand-name-gen

Repository files navigation

Random Name GEnerator

NPM Version license: MIT Downloads

Logo

Description

rand-name-gen is a simple and lightweight npm package for generating random names.

Installation

Install the package with npm:

npm install rand-name-gen

Usage

const rand = require("rand-name-gen");

console.log(rand.randomName()); // Output: { 'John Doe' }
console.log(rand.randomName({ title: true })); // Output: { 'Mr. John Doe' }
console.log(rand.randomName({ firstName: true })); // Output: { 'John' }
console.log(rand.randomName({ lastName: true })); // Output: { 'Doe' }

OR

import { randomName } from "rand-name-gen";

console.log(randomName({ firstName: true, lastName: true })); // Output: { 'John Doe' }
console.log(randomName({ title: true, firstName: true })); // Output: { 'Mr. John' }
console.log(randomName({ title: true, firstName: true, lastName: true })); // Output: { 'Mr. John Doe' }

API

  • randomName() - Returns a random full name without title.
  • randomName({ title: true }) - Returns a random full name with a title.
  • randomName({ firstName: true }) - Returns a random first name.
  • randomName({ lastName: true }) - Returns a random last name.
  • randomName({ title: true, firstName: true }) - Returns a random first name with a title.
  • randomName({ title: true, lastName: true }) - Returns a random last name with a title.
  • randomName({ firstName: true, lastName: true }) - Returns a random first and last name.
  • randomName({ title: true, firstName: true, lastName: true }) - Returns a random first and last name with a title.

Options

  • title - (Optional) - Boolean value to include a title.
  • firstName - (Optional) - Boolean value to include a first name.
  • lastName - (Optional) - Boolean value to include a last name.

License

This project is licensed under the MIT License.

Author

Preyan Bhowmick

About

Nothing to see here. Just a trial package to test pkg publishing in npm and jsr.

Topics

Resources

License

Stars

Watchers

Forks