Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
/ fizzbuzzify Public archive

Turn numbers into their corresponding fizzbuzz result

Notifications You must be signed in to change notification settings

n3dst4/fizzbuzzify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fizzbuzzify

Travis status

Turn numbers into their corresponding fizzbuzz result

Usage

Install:

npm install fizzbuzzify

Use:

// es6 style import:
import { fizzbuzzify } from "fizzbuzzify";

// or cjs/node/browserify-style:
var fizzbuzzify = require("fizzbuzzify")

// then:
console.log(fizzbuzzify(15)) // "FizzBuzz"

fizzbuzzify is a named export because I'm preferring that style these days, but also a default export for legacy compatibility.

Hacking and contribution

The code is written in es6 and transpiled into the __build folder as es5 by babel. This is done automatically before publishing to npm by the prepublish script config.

If you're working on this package and you want to generate the transpiled output, run:

npm run prepublish

Alternatively to keep babel running in watch mode while you work, run

npm run watch

Compatibility

This code should work fine in node and browsers.

Running tests

As usual, you can run npm test to run the tests. This will fire up Karma and attempt to start a Firefox instance.

When running in a Continuous Integration environment, the Karma configuration will run once and exit. Otherwise it will start up in "watch" mode.

Alternatively you can run npm run mocha to run the tests directly in Mocha (not using Karma) or npm run mocha-watch to keep mocha running the background and re-running the tests when the code changes.

For the love of gosh, why?

This package is part of a larger project that's half joke and half genuine demonstration of "cool things in software development". Go see fizzbuzz-cli for the full write-up.

About

Turn numbers into their corresponding fizzbuzz result

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published