Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. — http://wiki.c2.com/?FizzBuzzTest
This package has no production dependencies, however development dependencies can be installed using npm.
npm installOr for the pedantic:
npm install --only=devTo run the classic example. (This will run src/main.js):
node .To choose your own Fizz and Buzz numbers:
const { fizzbuzz } = require("./src/fizzbuzz");
const fn = fizzbuzz({ fizz: 3, buzz: 5 });
fn(1); // '1'
fn(3); // 'Fizz'
fn(5); // 'Buzz'
fn(15); // 'FizzBuzz'Testing is performed using jest.
npm run testStaged changes are automatically linted and formatted on pre-commit using husky, lint-staged and pretty-quick.
Linting is performed using eslint.
npm run lintFormatting is performed using prettier (via pretty-quick).
npm run format