phraseoid

1.0.1 • Public • Published

phraseoid

A simple nodejs library to generate random phrases from a list of words.

Installation

npm install phraseoid

Usage

import { Phraseoid } from "phraseoid";

const phraseoid = new Phraseoid();
phraseoid.terms = {
  name: ["Alice", "Bob"],
  place: ["park", "library"],
  colour: ["red", "blue"],
  animal: ["cat", "dog"],
  adjective: ["happy", "sad", "angry"],
  vehicle: ["car", "bike", "ambulance"],
  verb: ["run", "jump"],
  thing: ["car", "bike"],
  colouredThing: ["{{colour}} {{thing}}"],
};
phraseoid.phrases = [
  "Hello, my name is {{name}} and I like {{thing}} and {{animal|plural}} amd I live in {{place|indefinite}}.",
];
const phrase = phraseoid.generatePhrase();

Readme

Keywords

none

Package Sidebar

Install

npm i phraseoid

Weekly Downloads

119

Version

1.0.1

License

MIT

Unpacked Size

46 kB

Total Files

11

Last publish

Collaborators

  • piers