Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romelperez/empanada
Simple data mock generator.
https://github.com/romelperez/empanada
data generator javascript mock typescript
Last synced: 3 months ago
JSON representation
Simple data mock generator.
- Host: GitHub
- URL: https://github.com/romelperez/empanada
- Owner: romelperez
- License: mit
- Created: 2020-06-11T02:25:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-03T19:12:37.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T08:18:40.537Z (3 months ago)
- Topics: data, generator, javascript, mock, typescript
- Language: TypeScript
- Homepage:
- Size: 591 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Empanada](https://github.com/romelperez/empanada/raw/main/empanada.jpg)
# Empanada
Simple data mock generator.
[![version](https://img.shields.io/npm/v/empanada.svg)](https://npmjs.org/package/empanada)
[![ci](https://github.com/romelperez/empanada/workflows/ci/badge.svg)](https://github.com/romelperez/empanada/actions)
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/empanada.svg)](https://npmjs.org/package/empanada)
[![downloads](https://img.shields.io/npm/dm/empanada.svg)](https://npmjs.org/package/empanada)
[![github stars](https://img.shields.io/github/stars/romelperez/empanada.svg?style=social&label=stars)](https://github.com/romelperez/empanada)
[![license](https://img.shields.io/github/license/romelperez/empanada.svg?maxAge=2592000)](https://github.com/romelperez/empanada/blob/main/LICENSE)## Installation
```bash
npm install empanada
```## How to use
### CJS
```js
const { createRandomWords } = require('empanada');
```### ESM
```js
import { createRandomWords } from 'empanada';
```### UMD
#### Node/Bundler
```js
import { createRandomWords } from 'empanada/build/umd/empanada.min.js';
```#### Browser
```html
const { createRandomWords } = window.empanada;
```
## API
### `LOREM_IPSUM: string`
A long lorem ipsum text example.
### `createRandomWords(length: number = 3): string`
Create a string with random words.
```ts
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".
```ts
import { createRandomEmail } from 'empanada';console.log(createRandomEmail());
// "[email protected]"
```