1.0.1 • Published 1 year ago

@thomasmatthewfletcher/fizzbuzz v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

fizzbuzz

Usage

First, generate a FizzBuzz instance:

import { FizzBuzz } from '@thomasmatthewfletcher/fizzbuzz'

const fb = new FizzBuzz({
  values: [
    { value: 3, text: 'Fizz' },
    { value: 5, text: 'Buzz' }
  ]
});

Then use .next() to generate the next FizzBuzz value:

fb.next(); // "1"
fb.next(); // "2"
fb.next(); // "Fizz"
fb.next(); // "4"
fb.next(); // "Buzz"

You can use .get() to get a specific value:

fb.get(30); // "FizzBuzz"

You can use .getBetween(start, end) to get an array of values:

fb.getBetween(10, 15) // ["Buzz", "11", "Fizz", "13", "14", "FizzBuzz"]
1.0.1

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago