2.0.0 • Published 1 year ago

randomwordsgenerator v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

RandomWordsGenerator

Minimal, Small, Easy library for generating Random words from English Dictionary.

import {RWG} from 'randomwordsgenerator';

let rwg = new RWG();

console.log(rwg.GetWords());
console.log(rwg.GetWords({count:132}));

Installation

This is NPM Library (Not a project). You can import this library and use its functionalty.

$ npm i randomwordsgenerator

How to use it

Create object of RWG Class

let rwg = new RWG()

Parameters for GetWords

  • count: number - undefined default
  • minLength: number - undefined default
  • maxLength: number - undefined default
  • exactLength: number - undefined default
  • mustContain: string - undefined default
  • startWith: string - undefined default
  • endWith: string - undefined default

Example

//get all words
console.log(rwg.GetWords())

//get ranodm 15 words
console.log(rwg.GetWords({count:15}))

//get random 15 words with atleast length of 5
console.log(rwg.GetWords({count:15, minLength:5}))

//get random 15 words with atleast length of 5 and maximum of 9
console.log(rwg.GetWords({count:15, minLength:5, maxLength:9}))

//get random 15 words which includes specific sequence of char
console.log(rwg.GetWords({count:15, mustContain:"te"}))

You can use combination of those properties as per your requirements.

2.0.0

1 year ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago