GithubHelp home page GithubHelp logo

five's Introduction

five.js

A library to overcomplicate 5.

Build Status Code Climate Test Coverage

logo

Usage

Require the module
var five = require('five');
In the browser
<script type="text/javascript" src="./five.js"></script>
Basic 5
five(); // 5

The Law of Fives

five.law(); // The Law of Fives states simply that: All things happen in fives, or are divisible by or are multiples of five, or are somehow directly or indirectly appropriate to 5. The Law of Fives is never wrong.
Addition
five() + five(); // 10
Multiplication
five() * five(); // 25
Division
five() / five(); // 1
Combinatorics
five.factorial(); // 120
Different sorts of 5
five.upHigh() // ⁵
five.downLow() // ₅
five.tooSlow() // 5, with a ~500 millisecond delay
five.roman() // V
five.morseCode() // .....
five.negative() // -5
five.loud() // FIVE
five.loud('piglatin') // IVEFAY
five.smooth() // S
five.bucks() // $5.00
Cryptography
five.mdFive() // 30056e1cab7a61d256fc8edd970d14f5
five.golden() // 1.618033988749895
5 goes multilingual
five.arabic() // خمسة
five.azerbaijani() // beş
five.basque() // bost
five.belarusian() // пяць
five.bosnian() // pet
five.bulgarian() // пет
five.catalan() // cinc
five.chinese() // 五
five.chinese('pinyin') // wǔ
five.chinese('financial') // 伍
five.choctaw() // tahlapi
five.croatian() // pet
five.czech() // pět
five.dothraki() // mek
five.dovah() // hen
five.dutch() // vijf
five.elvish() // lempë
five.elvish('quenya') // lempë
five.elvish('sindarin') // leben
five.english() // five
five.esperanto() // kvin
five.estonian() // viis
five.finnish() // viisi
five.french() // cinq
five.german() // fünf
five.greek() // πέντε
five.hebrew() // חמש
five.hindi() // पांच
five.hungarian() // öt
five.icelandic() // fimm
five.indonesian() // lima
five.irish() // cúig
five.italian() // cinque
five.japanese() // 五
five.kannada() // ಐದು
five.klingon() // vagh
five.korean() // 오
five.latin() // quinque
five.latvian() // pieci
five.lithuanian() // penki
five.maltese() // ħamsa
five.mongolian() // таван
five.nepali() // पाँच
five.norwegian() // fem
five.persian() // پنج
five.piglatin() // ivefay
five.polish() // pięć
five.portuguese() // cinco
five.punjabi() // ਪੰਜ
five.romanian() // cinci
five.russian() // пять
five.serbian() // pet
five.sinhala() // පහ
five.slovakian() // päť
five.slovenian() // pet
five.spanish() // cinco
five.swedish() // fem
five.tamil() // ஐந்து
five.telugu() // ఐదు
five.thai() // ห้า
five.turkish() // beş
five.ukrainian() // п’ять
five.welsh() // pump
Different radices
five.binary(); // 101
five.octal(); // 5
five.hex(); // 5
five.base(4); // 11
five.base(3); // 12
Assertion
five.isFive(10); // false
Filter, Map and Reduce
five.filter([5, true, 5]); // [5, 5]
five.map([1, 2, 3]); // [5, 5, 5]
five.reduce([1, 2, 3]); // 5
Novelty
five.fab(); // ['Juwan Howard','Ray Jackson','Jimmy King','Jalen Rose','Chris Webber']
five.jackson(); // ['Jackie','Tito','Jermaine','Marlon','Michael']
five.furious(); // ['Tigress','Viper','Crane','Monkey','Mantis']
five.luniz(); // ‘I Got 5 on It’
five.r(); // '£5'
five.funk(); // '5 bad boys with the power to rock you'
five.high(); // 'o/'
five.members(); //['Sean Conlon', 'Ritchie Neville', 'Scott Robinson', 'Jason \'J\' Brown', 'Abz Love']
five.discography(); //['5ive', 'Invincible', 'Kingsize']
five.singles(); //['Slam Dunk (Da Funk)', 'When the Lights Go Out', 'Got the Feelin\'', 'Everybody Get Up', 'It\'s the Things You Do', 'Until the Time Is Through', 'If Ya Gettin\' Down', 'Keep On Movin\'', 'Don\'t Wanna Let You Go', 'We Will Rock You', 'Let\'s Dance', 'Closer to Me', 'Rock the Party', 'I Wish It Could Be Christmas Everyday']
five.famous(); // ['Julian', 'Dick', 'George', 'Anne', 'Timmy']
five.fiveFiveFive(); // 'Interstella 5555: The 5tory of the 5ecret 5tar 5ystem'
Rotation
five.rot("five.js"); //"knaj.ox"
Asynchronous Usage
five.async(function(err, five) {
	// five === 5
});
Unicode
five.oclock(); // '🕔'

five.oclockSomewhere(); // '🍺'

five.guys(); // '🍔'
Money
five.euro(); // '5€'
five.dollar(); // '$5'

Development

The code

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

./five.js
Tests
npm test

License

MIT

five's People

Contributors

alexeyraspopov avatar alexwilson avatar atomic1fire avatar bttmly avatar colinvh avatar doughale avatar dwardu89 avatar ewanharris avatar gsinti avatar guymeurice avatar hermannbjorgvin avatar jackdcrawford avatar jamiees2 avatar jjshoe avatar joezo avatar justineo avatar lekoaf avatar mantisimo avatar ormanli avatar phiat avatar raymond-h avatar rpgeeganage avatar sea-erkin avatar shackpank avatar stevetauber avatar techgaun avatar thedumbterminal avatar tmarki avatar vikramsoni2 avatar yous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

five's Issues

How about add 'ら'

'' is a japanese character represent the sound [ra]

It looks like 5 isn't it?

five.japanize() // ら

five.log

Prints all five functions/methods to console. :)

five.log = function() {
console.log('five: ', five);
console.log('five.law: ', five.law);
console.log('five.upHigh: ', five.upHigh);
console.log('five.downLow: ', five.downLow);
console.log('five.roman: ', five.roman);
console.log('five.convertTo: ', five.convertTo(5));
console.log('five.arabic: ', five.arabic);
console.log('five.azerbaijani: ', five.azerbaijani);
console.log('five.basque: ', five.basque);
console.log('five.belarusian: ', five.belarusian);
console.log('five.bosnian: ', five.bosnian);
console.log('five.bulgarian: ', five.bulgarian);
console.log('five.catalan: ', five.catalan);
console.log('five.chinese: ', five.chinese);
console.log('five.choctaw: ', five.choctaw);
console.log('five.croatian: ', five.croatian);
console.log('five.czech: ', five.czech);
console.log('five.dothraki: ', five.dothraki);
console.log('five.dovah: ', five.dovah);
console.log('five.dutch: ', five.dutch);
console.log('five.elvish: ', five.elvish);
console.log('five.esperanto: ', five.esperanto);
console.log('five.estonian: ', five.estonian);
console.log('five.finnish: ', five.finnish);
console.log('five.french: ', five.french);
console.log('five.german: ', five.german);
console.log('five.greek: ', five.greek);
console.log('five.hebrew: ', five.hebrew);
console.log('five.hindi: ', five.hindi);
console.log('five.hungarian: ', five.hungarian);
console.log('five.icelandic: ', five.icelandic);
console.log('five.indonesian: ', five.indonesian);
console.log('five.irish: ', five.irish);
console.log('five.italian: ', five.italian);
console.log('five.japanese: ', five.japanese);
console.log('five.kannada: ', five.kannada);
console.log('five.klingon: ', five.klingon);
console.log('five.korean: ', five.korean);
console.log('five.latin: ', five.latin);
console.log('five.latvian: ', five.latvian);
console.log('five.lithuanian: ', five.lithuanian);
console.log('five.maltese: ', five.maltese);
console.log('five.mongolian: ', five.mongolian);
console.log('five.nepali: ', five.nepali);
console.log('five.norwegian: ', five.norwegian);
console.log('five.persian: ', five.persian);
console.log('five.piglatin: ', five.piglatin);
console.log('five.polish: ', five.polish);
console.log('five.portuguese: ', five.portuguese);
console.log('five.punjabi: ', five.punjabi);
console.log('five.romanian: ', five.romanian);
console.log('five.russian: ', five.russian);
console.log('five.serbian: ', five.serbian);
console.log('five.sinhala: ', five.sinhala);
console.log('five.slovakian: ', five.slovakian);
console.log('five.slovenian: ', five.slovenian);
console.log('five.spanish: ', five.spanish);
console.log('five.swedish: ', five.swedish);
console.log('five.tamil: ', five.tamil);
console.log('five.telugu: ', five.telugu);
console.log('five.turkish: ', five.turkish);
console.log('five.thai: ', five.thai);
console.log('five.ukrainian: ', five.ukrainian);
console.log('five.base: ', five.base);
console.log('five.binary: ', five.binary);
console.log('five.octal: ', five.octal);
console.log('five.hex: ', five.hex);
console.log('five.mdFive: ', five.mdFive);
console.log('five.golden: ', five.golden);
console.log('five.factorial: ', five.factorial);
console.log('five.negative: ', five.negative);
console.log('five.loud: ', five.loud);
console.log('five.smooth: ', five.smooth);
console.log('five.tooSlow: ', five.tooSlow);
console.log('five.emitter: ', five.emitter);
console.log('five.high: ', five.high);
console.log('five.isFive: ', five.isFive);
console.log('five.map: ', five.map);
console.log('five.filter: ', five.filter);
console.log('five.reduce: ', five.reduce);
console.log('five.fab: ', five.fab);
console.log('five.jackson: ', five.jackson);
console.log('five.members: ', five.members);
console.log('five.discography: ', five.discography);
console.log('five.singles: ', five.singles);
console.log('five.fiveFiveFive: ', five.fiveFiveFive);
console.log('five.furious: ', five.furious);
console.log('five.famous: ', five.famous);
console.log('five.luniz: ', five.luniz);
console.log('five.funk: ', five.funk);
console.log('five.async: ', five.async);
console.log('five.r: ', five.r);
console.log('five.euro: ', five.euro);
console.log('five.dollar: ', five.dollar);
console.log('five.rot: ', five.rot);
console.log('five.oclock: ', five.oclock);
console.log('five.oclockSomewhere: ', five.oclockSomewhere);
console.log('five.guys: ', five.guys);
console.log('five.bucks: ', five.bucks);
}

Support for l33t speak

This would've been a pull instead, if only I knew which l33t variant is the best one - The original H4X0R or the symbolic leet?

OMFG So many choices. IMHO, there should be a five for every single variant of l33t, you know, just because.

Does five come as a jQuery plugin?

This is useless unless it works with jQuery. Anyone who is a hacker uses jQuery and not JavaScript because it is broken and doesn't work on IE.

High $.five()

Top five universities

Need a function to return top 5 universities either national or worldwide

I am working on it now

The i18n / l10n doesn't scale

This project has/had an awesome amount of PRs in to make it multilingual by default, but with how things are currently implemented, they tend to conflict with each other. Can we come up with something better?

Are you crazy???

Why, Oh my GOD! Why do you need this shit? Didn't it be better to write -5 instead of five().negative()? Oh, God... And WHY FIVE??? Why not four, o three, of two, maybe twenty five???

We need a logo

as a maintainer i need a logo
so that i can buy five stickers

complex

As a user of five
I would like to get five in a complex way
So that I can use five and feel better about it

please implement five.complex()

Please add dependencies to get to five.

Hey can we get one the following dependencies going as well?

  • one
  • two
  • three
  • four

Currently my work is something like this which I think can be streamlined with better dependency support.

five() - 4 // 1
five() - 3 // 2
five() - 2 // 3
five() - 1 // 4

Thank you for this contribution to the Open source community. This will move the JS community to new heights!

Not OOP enough

This is a horror. There should be a Five class, and methods should be stackable.

Number --------------Five (final)
|
|
|
|
Impossibility
|
|
|
Four

jackson.five()

Stream API support for piping Jackie, Tito, Jermaine, Marlon and Michael images, audio and video to all your favorite Node.js applications.

I'll be there, Never can say goodbye girl, ABC and all the hits.
Tito, don't you marry that girl.

Factorization

This library lacks the ability to factorize the number 5.

Proposed API:

five.factorize(); // [5]

five.async usage in browser

The current implementation of five.async uses process.nextTick, which is a nodejs specific API. This won't work in a browser apparently.
I'd fix this by checking if there is a process variable. I could make a PR soon.

Who want excessive 5s, I have so many and be willing to give to others.

No need to thank :)

55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555

On the one hand

On the one hand … this is great, quite literally.

But after searching Github, I’ve been unable to find the rest of the set. For example, what about three()? and what about constants, like pi()?

I understand that making all numbers overly complicated could take time, so what’s the ETA?

Split up the monolith

Currently five is something of a monolith, exposing way too many methods.

I believe a library should do one thing and one thing well, so I suggest that you split five into several modules, ideally only exposing one method per module as a default export. Possibly, as a compromise, there could be a five-i18n module for the multilingual stuff.

I see a couple of options going forward:

  • Start a Github organization with a repository for each module. "five" is taken, so maybe "five.io" would be a suitable name for the organization.
  • Keep everything in a monorepo. You might need to be vocal about this, including the rationale about a monorepo in the documentation, noting that Facebook and Google are doing the same.

five.image()

Return the base64 or image link of the five logo:

asd

In chinese,伍 is another five

In chinese,伍 is another five. It is used in Money.
In chinese, all the numbers have two styles.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
一, 二, 三, 四, 五, 六, 七 ,八, 九, 十
壹, 贰, 叁, 肆, 伍, 陆, 柒, 捌, 玖, 拾

The third style is used in paper money and coin.

Consider adding five.times()

It would be really handy to have a five.times() function that does the following:

  • If a number x is passed to it, calculate five() * x
  • If a function f is passed to it, execute it five times

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.