{"id":16889042,"url":"https://github.com/algesten/fnuc","last_synced_at":"2025-08-10T07:15:52.471Z","repository":{"id":26007185,"uuid":"29449751","full_name":"algesten/fnuc","owner":"algesten","description":"a functional library for coffeescript (and javascript)","archived":false,"fork":false,"pushed_at":"2015-12-05T04:26:35.000Z","size":513,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-11T16:15:52.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/algesten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-19T02:21:18.000Z","updated_at":"2024-05-02T13:38:23.000Z","dependencies_parsed_at":"2022-08-30T00:11:22.865Z","dependency_job_id":null,"html_url":"https://github.com/algesten/fnuc","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/algesten/fnuc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algesten%2Ffnuc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algesten%2Ffnuc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algesten%2Ffnuc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algesten%2Ffnuc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/algesten","download_url":"https://codeload.github.com/algesten/fnuc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algesten%2Ffnuc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269690619,"owners_count":24459874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:55:19.577Z","updated_at":"2025-08-10T07:15:52.427Z","avatar_url":"https://github.com/algesten.png","language":"CoffeeScript","readme":"(fnuc) -\u003e\n=========\n\n[![Build Status](https://travis-ci.org/algesten/fnuc.svg)](https://travis-ci.org/algesten/fnuc) [![Gitter](https://d378bf3rn661mp.cloudfront.net/gitter.svg)](https://gitter.im/algesten/fnuc)\n\n\u003e cause i want it my way.\n\nfnuc is a library for [functional programming][funcp] in coffeescript\n(and javascript). The reason for providing the \"standard\" javascript\nmethods as pure functions is to facilitate\n[functional composition][compo] and [higher order functions][highf].\n\n### Installing with NPM\n\n```bash\nnpm install -S fnuc\n```\n\nInject into global\n\n```javascript\nrequire('fnuc').expose(global);\n```\n\nOr use it library style with a prefix:\n\n```javascript\nF = require('fnuc');  // all functions under F\n```\n\nUse destructuring assignment to pick things you want.\n\nCoffeescript\n\n```coffee\n{split, map} = require 'fnuc'\n```\n\nJavascript\n\n```javascript\nlet {split, map} = require('fnuc');\n```\n\n### Installing with Bower\n\n```bash\nbower install -S fnuc\n```\n\n### Compatibility\n\nTested on IE9+, Chrome 38+, Firefox 34+, Safari 7+.\n\nAbout\n-----\n\nDesign philosophy:\n\n*  fnuc tries to follow the\n   [principle of least astonishment][princ]. This shows in function\n   argument order which is clearly spelled out in this\n   [stack overflow answer][stack].\n\n*  Less is more. fnuc provides the most used basics, not every\n   conceivable utility function. Please\n   [suggest](https://github.com/algesten/fnuc/issues) functions to add\n   if anything important is missing.\n\n*  Javascript is liberating. Functional programming purists may argue\n   the virtues of [immutability][immut] and typing whilst I would\n   argue the opposite; the lack of rigour has made programming fun\n   again. fnuc embraces all of javascript and will mutate where\n   appropriate.\n\n\n### Argument order\n\nWe expect a function such as `div` to have the following two forms:\n\n```coffee\ndiv(a, b)    # a divided by b\ndiv(b)(a)    # right section (`div` b)\n```\n\n`div` is [curried][curry] and `div10 = div(10)` can only have the meaning\n*division by 10*. Hence `div10 20` should equal `2`.\n\nOther least astonished variants that are *not in fnuc*:\n\n```coffee\ndiv(_, b)    # left section (a `div`)\na `div` b    # infix haskell style\na.div b      # infix coffeescript style\n```\n\n### plift\n\nPlifting is a strategy for using *simple functions* (perhaps even\n[pure functions][puref]) when dealing with [promises][proms].\n\nThere is a separate [page on plifting](plift.md).\n\n\nAPI\n---\n\n[`I`](api.md#i)\n[`add`](api.md#add)\n[`all`](api.md#all)\n[`always`](api.md#always)\n[`and`](api.md#and)\n[`any`](api.md#any)\n[`apply`](api.md#apply)\n[`arity`](api.md#arity)\n[`arityof`](api.md#arityof)\n[`at`](api.md#at)\n[`both`](api.md#both)\n[`call`](api.md#call)\n[`clone`](api.md#clone)\n[`comp`](api.md#comp)\n[`compose`](api.md#compose)\n[`concat`](api.md#concat)\n[`cond`](api.md#cond)\n[`contains`](api.md#contains)\n[`converge`](api.md#converge)\n[`curry`](api.md#curry)\n[`div`](api.md#div)\n[`drop`](api.md#drop)\n[`each`](api.md#each)\n[`either`](api.md#either)\n[`eq`](api.md#eq)\n[`eql`](api.md#eql)\n[`evolve`](api.md#evolve)\n[`filter`](api.md#filter)\n[`firstfn`](api.md#firstfn)\n[`flip`](api.md#flip)\n[`fold1`](api.md#fold1)\n[`fold`](api.md#fold)\n[`foldr1`](api.md#foldr1)\n[`foldr`](api.md#foldr)\n[`get`](api.md#get)\n[`gt`](api.md#gt)\n[`gte`](api.md#gte)\n[`has`](api.md#has)\n[`head`](api.md#head)\n[`iif`](api.md#iif)\n[`index`](api.md#index)\n[`indexfn`](api.md#indexfn)\n[`isdef`](api.md#isdef)\n[`isplain`](api.md#isplain)\n[`join`](api.md#join)\n[`keys`](api.md#keys)\n[`keyval`](api.md#keyval)\n[`last`](api.md#last)\n[`lastfn`](api.md#lastfn)\n[`lcase`](api.md#lcase)\n[`len`](api.md#len)\n[`lt`](api.md#lt)\n[`lte`](api.md#lte)\n[`map`](api.md#map)\n[`match`](api.md#match)\n[`max`](api.md#max)\n[`maybe`](api.md#maybe)\n[`merge`](api.md#merge)\n[`min`](api.md#min)\n[`mixin`](api.md#mixin)\n[`mod`](api.md#mod)\n[`mul`](api.md#mul)\n[`not`](api.md#not)\n[`nth`](api.md#nth)\n[`ofilter`](api.md#ofilter)\n[`omap`](api.md#omap)\n[`once`](api.md#once)\n[`or`](api.md#or)\n[`pall`](api.md#pall)\n[`partial`](api.md#partial)\n[`partialr`](api.md#partialr)\n[`pfail`](api.md#pfail)\n[`pick`](api.md#pick)\n[`pipe`](api.md#pipe)\n[`plift`](api.md#plift)\n[`replace`](api.md#replace)\n[`reverse`](api.md#reverse)\n[`search`](api.md#search)\n[`set`](api.md#set)\n[`shallow`](api.md#shallow)\n[`slice`](api.md#slice)\n[`sort`](api.md#sort)\n[`split`](api.md#split)\n[`sub`](api.md#sub)\n[`tail`](api.md#tail)\n[`take`](api.md#take)\n[`tap`](api.md#tap)\n[`trim`](api.md#trim)\n[`type`](api.md#type)\n[`typeis`](api.md#typeis)\n[`ucase`](api.md#ucase)\n[`unapply`](api.md#unapply)\n[`uniq`](api.md#uniq)\n[`uniqfn`](api.md#uniqfn)\n[`values`](api.md#values)\n[`zip`](api.md#zip)\n[`zipobj`](api.md#zipobj)\n[`zipwith`](api.md#zipwith)\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright © 2015 Martin Algesten\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[funcp]: https://en.wikipedia.org/wiki/Functional_programming\n[highf]: https://en.wikipedia.org/wiki/Higher-order_function\n[princ]: http://en.wikipedia.org/wiki/Principle_of_least_astonishment\n[stack]: http://stackoverflow.com/questions/25674596/#25720884\n[curry]: https://en.wikipedia.org/wiki/Currying\n[compo]: https://en.wikipedia.org/wiki/Function_composition_%28computer_science%29\n[immut]: https://en.wikipedia.org/wiki/Immutable_object\n[puref]: https://en.wikipedia.org/wiki/Pure_function\n[proms]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgesten%2Ffnuc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgesten%2Ffnuc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgesten%2Ffnuc/lists"}