@akira0924/fizzbuzz
v1.0.0
Published
A JavaScript implementation of FizzBuzz.
Downloads
2
Readme
fizzbuzz
A JavaScript implementation of FizzBuzz.
Installation
$ npm install @kimamula/fizzbuzz
```
## Usage
### In JavaScript code
```js
const fizzbuzz = require('@kimamula/fizzbuzz')
fizzbuzz(1) // '1'
fizzbuzz(2) // '2'
fizzbuzz(3) // 'Fizz'
fizzbuzz(5) // 'Buzz'
fizzbuzz(15) // 'FizzBuzz'
```
### From the command line
```sh
$ npx fizzbuzz 1
1
$ npx fizzbuzz 2
2
$ npx fizzbuzz 3
Fizz
$ npx fizzbuzz 5
Buzz
$ npx fizzbuzz 15
FizzBuzz
```