Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dijs/fizzbuzz


https://github.com/dijs/fizzbuzz

Last synced: 13 days ago
JSON representation

Awesome Lists containing this project

README

        

# FizzBuzz

### Installation

Clone repository and run npm install

### Testing

Run npm test

### Usage

The fizzbuzz method iterates from 1 to the given upper bound and fires the given callback with each number and divisor result.

```
var fizzbuzz = require('/path/to/fizzbuzz/index.js');

// fizzbuzz(Upper Bound , Divisor Word Pairs, Result Callback Function)

// Example:

fizzbuzz(100, [{
divisor: 3,
word: 'fizz'
}, {
divisor: 5,
word: 'buzz'
}], function(n, result){
// Do stuff...
});

```