Skip to content

romelperez/empanada

Repository files navigation

Empanada

Empanada

Simple data mock generator.

version ci npm bundle size downloads github stars license

Installation

npm install empanada

How to use

CJS

const { createRandomWords } = require('empanada');

ESM

import { createRandomWords } from 'empanada';

UMD

Node/Bundler

import { createRandomWords } from 'empanada/build/umd/empanada.min.js';

Browser

<script src="https://unpkg.com/empanada@latest/build/umd/empanada.min.js"></script>
<script>
  const { createRandomWords } = window.empanada;
</script>

API

LOREM_IPSUM: string

A long lorem ipsum text example.

createRandomWords(length: number = 3): string

Create a string with random words.

import { createRandomWords } from 'empanada';

console.log(createRandomWords(4));
// "amet nostrud lorem deserunt"

createRandomEmail(): string

Create a string with a random email address ending in ".com".

import { createRandomEmail } from 'empanada';

console.log(createRandomEmail());
// "consecteturelit@eiusmod.com"