five-plus

0.5.2 • Public • Published

five-plus

A library to overcomplicate 5. Better.

Idiomatic CoffeeScript rewrite of the legendary five.js by @jackdcrawford.

Build Status Code Climate

NPM

Usage

Require the module
Five = require 'five-plus'
In the browser
<script type="text/javascript" src="./lib/five.js"></script>
Basic 5
Five()                  # 5 
Addition
Five() + Five()         # 10 
Multiplication
Five() * Five()         # 25 
 
# Note: a more idiomatic way to do this in CoffeeScript 
Five() ** 2             # 25 
Division
Five() / Five()         # 1 
Different sorts of 5
five = new Five()
 
five.upHigh()           # ⁵ 
five.downLow()          # ₅ 
five.tooSlow()          # 5, with a ~500 millisecond delay 
five.roman()            # V 
five.morseCode()        # di-di-di-di-dit 
5 goes multilingual
five = new Five()
 
five.arabic()           # خمسة 
five.choctaw()          # tahlapi 
five.croatian()         # pet 
five.czech()            # pět 
five.english()          # Five 
five.finnish()          # viisi 
five.french()           # cinq 
five.german()           # fünf 
five.irish()            # cúig 
five.italian()          # cinque 
five.mongolian()        # таван 
five.piglatin()         # ivefay 
five.polish()           # pięć 
five.slovenian()        # pet 
five.spanish()          # cinco 
five.swedish()          # fem 
five.thai()             # ห้า 
Different radices
five = new Five()
 
five.binary()           # 101 
five.octal()            # 5 
Map and Reduce
five.map [123]      # [5, 5, 5] 
five.reduce [123]   # 5 

Development

The code

All of the logic & heavy lifting is achieved in one self-contained file:

./lib/five.js
Compiling

Compilation is done using cake under the hood with an npm-prepublish script:

npm install
Tests
npm test

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i five-plus

    Weekly Downloads

    0

    Version

    0.5.2

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • barretron