txtgen
Lightweight util for generating random sentences, paragraphs and articles in English. Inspired by Sentencer and metaphorpsum.com.
Demo
See how it works?
Setup
Usage
var txtgen = require('txtgen');
let sentence = txtgen.sentence();
console.log(sentence);
let paragraph = txtgen.paragraph();
console.log(paragraph);
let article = txtgen.article();
console.log(article);
APIs
- .sentence()
- .paragraph([Number totalSentences])
- .article([Number totalParagraphs])
- .addNouns([Array nouns])
- .addAdjectives([Array adjectives])
- .addTemplates([Array sentenceTemplates])
Test
git clone https://github.com/ndaidong/txtgen.git
cd txtgen
npm install
npm test
License
The MIT License (MIT)