# lorempostgen

> Auto-generator for lorem ipsum and lorempixel posts

Latest version **1.1.2** (published 2018-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install lorempostgen
pnpm add lorempostgen
yarn add lorempostgen
bun add lorempostgen
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2018-01-26 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Toby Worth |
| Maintainers | fieldmarshallvague |
| Keywords | lorem-ipsum, lorem-pixel |

## Links

- npm: https://www.npmjs.com/package/lorempostgen
- Repository: https://github.com/FieldMarshallVague/lorem-post-generator
- Homepage: https://github.com/FieldMarshallVague/lorem-post-generator#readme
- Issues: https://github.com/FieldMarshallVague/lorem-post-generator/issues
- npm.io page: https://npm.io/package/lorempostgen

## Dependencies (1)

- [rxjs](https://npm.io/package/rxjs.md) ^5.5.6

## Recent versions

- 1.1.2 (latest) — 2018-01-26
- 1.1.1 — 2018-01-25
- 1.1.0 — 2018-01-25
- 1.0.9 — 2018-01-18
- 1.0.8 — 2018-01-18
- 1.0.7 — 2018-01-18
- 1.0.6 — 2018-01-12
- 1.0.5 — 2018-01-12
- 1.0.4 — 2018-01-12
- 1.0.3 — 2018-01-11
- 1.0.2 — 2018-01-11
- 1.0.1 — 2018-01-11
- 1.0.0 — 2018-01-11

## README

# Lorem Post Generator

Simple tool for creating a json file of posts containing lorem ipsum text and lorempixel images, to act as a test dataset for UI prototyping feeds.

## Usage

Instantiate LoremPostGenerator with a config object then call .generate() with a number of posts.

    const config = {
        startDate: new Date(2000,0,1),
        endDate: new Date(2018,0,11),
        textTemplate: "blah ",
        minContentLength: 100,
        maxContentLength: 10000,
        minImages: 0,
        maxImages: 5,
        useLoremImages: true
        minAsyncDelay: 0,
        maxAsyncDelay: 200,
        streamPageSize: 5
    }

    const postGenerator = new LoremPostGenerator(config);

    // Synchronous
    let posts = postGenerator.generate(1000);

    // Rx Observable
    let asyncPosts = postGenerator.generateAsync(100);

    // Rx BehaviorSubject with [maxAsyncDelay] between pages of [streamPageSize]
    let streamedPosts = postGenerator.generateSubject(100);

### startDate and endDate

The date range boundaries to generate posts within.

### textTemplate

The source text to use for the post body.  This defaults to the first paragraph of Lorem Ipsum text.

### min and maxContentLength

The textTemplate is repeated as necessary to have a length between min and maxContentLength.

### min and maxImages

Images are placed randomly within the post body, to give the overall feed an authentic look.

### useLoremImages

You can use Lorem images from Picsum or just default to empty image placeholders.

### minAsyncDelay

Not implemented yet

### maxAsyncDelay

Used for the delay in each page being emitted by generateSubject's stream

### streamPageSize

The size of each page emitted by generateSubject

---
_Source: https://npm.io/package/lorempostgen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
