Skip to content

Releases: xyfir/rword

4.0.0

04 Feb 03:31
fc59765
Compare
Choose a tag to compare

V3 to V4 Migration Guide

  • Imports:
    • Rword now exports an ES Module instead of CommonJS
    • Instead of importing a global rword instance, import the Rword class and then a separate word list like the rword-english-recommended package
  • Instantiation: Create an instance of Rword with the desired word list and optional seed
  • API Methods: The methods now belong to an instance and the options object is removed for filtering

Upgrade Steps

  1. Import:

    • V3
    import { rword } from 'rword';
    • V4
    import { words } from 'rword-english-recommended'; // or 'rword-english-extended'
    import { Rword } from 'rword'; // Capitalized export
  2. Create instance:

    • V3: Not needed
    • V4
    const rword = new Rword(words);
  3. Generate words:

    • V3
    // has filtering options
    // might return a string, or an array
    rword.generate(5, { length: '3-10', contains: /pattern/ });
    // has generateFromPool method for improved performance
    rword.generateFromPool(5);
    • V4
    // only the number of words is accepted
    // always returns an array
    // only has a single generate method
    rword.generate(5);

If you need the old filtering options, you should do this yourself on a words array and then load that new aray into an instance.

3.2.1

11 Feb 20:02
Compare
Choose a tag to compare
  • Improve TypeScript return type of generate() (thanks @waspeer)
  • Update development dependencies
  • Fix tests

3.2.0

26 Nov 04:23
Compare
Choose a tag to compare

Remove unwanted words

3.1.2

03 Oct 15:26
Compare
Choose a tag to compare

Clean up code

3.1.1

25 Apr 15:00
Compare
Choose a tag to compare

3.1.0

25 Apr 14:22
Compare
Choose a tag to compare

3.0.1

23 Mar 17:17
Compare
Choose a tag to compare

3.0.1