{"id":13547801,"url":"https://github.com/nullobject/fkit","last_synced_at":"2025-05-16T18:09:29.727Z","repository":{"id":19838469,"uuid":"23100020","full_name":"nullobject/fkit","owner":"nullobject","description":"A functional programming toolkit for JavaScript.","archived":false,"fork":false,"pushed_at":"2021-08-31T01:39:39.000Z","size":2233,"stargazers_count":584,"open_issues_count":2,"forks_count":12,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-16T12:38:54.586Z","etag":null,"topics":["fp","functional","functional-programming","javascript","library"],"latest_commit_sha":null,"homepage":"https://fkit.joshbassett.info","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullobject.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-08-19T06:52:00.000Z","updated_at":"2025-05-09T17:32:05.000Z","dependencies_parsed_at":"2022-07-27T00:46:55.183Z","dependency_job_id":null,"html_url":"https://github.com/nullobject/fkit","commit_stats":null,"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Ffkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Ffkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Ffkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullobject%2Ffkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullobject","download_url":"https://codeload.github.com/nullobject/fkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582907,"owners_count":22095518,"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","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":["fp","functional","functional-programming","javascript","library"],"created_at":"2024-08-01T12:01:01.243Z","updated_at":"2025-05-16T18:09:29.680Z","avatar_url":"https://github.com/nullobject.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\u003cimg alt=\"FKit\" src=\"https://raw.githubusercontent.com/nullobject/fkit/master/logo.png\" width=\"256px\" /\u003e\u003c/h1\u003e\n\n[![Build Status](https://travis-ci.com/nullobject/fkit.svg?branch=master)](https://travis-ci.com/nullobject/fkit)\n\nFKit (pronounced eff-kit) is a [functional\nprogramming](http://en.wikipedia.org/wiki/Functional_programming) toolkit for\nJavaScript. It provides many functions for solving common problems with\nfunctions, objects, arrays, and strings. It aims to provide reusable building\nblocks while maintaining a laser focus on everyday utility.\n\nFeatures:\n\n* Why reinvent the wheel? FKit provides many functions for solving everyday\n  problems to do with functions, arrays, objects, and strings.\n\n* FKit treats both strings and arrays as *lists*, which means you can apply the\n  same list functions to both strings and arrays (e.g. `head`, `tail`, `map`,\n  `filter`, `fold`, etc).\n\n* Most FKit functions are already\n  [curried](http://en.wikipedia.org/wiki/Currying) by default, so you can\n  [partially apply](http://en.wikipedia.org/wiki/Partial_application) them\n  wherever you need to.\n\n* The ordering of arguments to FKit functions is carefully designed to be more\n  natural, this makes them highly\n  [composable](http://en.wikipedia.org/wiki/Function_composition).\n\n* It's very compact, roughly 3 KB when minified and gzipped!\n\n## Table of Contents\n\n* [Getting Started](#getting-started)\n  * [Node](#node)\n  * [Browser](#browser)\n* [Documentation](#documentation)\n* [Examples](#examples)\n* [Licence](#licence)\n\n## Getting Started\n\n### Node\n\nInstall the npm package:\n\n```sh\n\u003e npm install fkit\n```\n\nImport just the functions you need:\n\n```js\nimport { add } from 'fkit'\nconsole.log(add(1, 2))\n```\n\nOr import the whole library:\n\n```js\nimport * as F from 'fkit'\nconsole.log(F.add(1, 2))\n```\n\n### Browser\n\nThe easiest way to start using FKit in your browser is to include it with a\n`\u003cscript\u003e` tag in your HTML file:\n\n```html\n\u003cscript src=\"https://unpkg.com/fkit/dist/fkit.min.js\"\u003e\u003c/script\u003e\n```\n\n## Documentation\n\n* [API documentation](http://fkit.joshbassett.info/)\n\n* Presentation by Josh Bassett: [Everyday Functional Programming in\n  JavaScript](https://speakerdeck.com/nullobject/fkit-everyday-functional-programming-in-javascript)\n\n* Article by Josh Bassett: [Take Your Code to the Next Level with\n  FKit](http://joshbassett.info/2014/take-your-code-to-the-next-level-with-fkit/)\n\n## Examples\n\nSum the numbers in a list:\n\n```js\nimport { sum } from 'fkit'\nsum([1, 2, 3]) // 6\n```\n\nStash a string:\n\n```js\nimport { map, surround } from 'fkit'\nmap(surround('{', '}'), 'hello') // '{h}{e}{l}{l}{o}'\n```\n\nIntersperse the numbers in a list with another number:\n\n```js\nimport { intersperse } from 'fkit'\nintersperse(4, [1, 2, 3]) // [1, 4, 2, 4, 3]\n```\n\nFilter the numbers in a list where 1 \u003c= n \u003c= 5:\n\n```js\nimport { between } from 'fkit'\n[1, 2, 3, 4, 5].filter(between(2, 4)) // [2, 3, 4]\n```\n\nCalculate the Cartesian product of two lists:\n\n```js\nimport { cartesian } from 'fkit'\ncartesian([1, 2], [3, 4]) // [[1, 3], [1, 4], [2, 3], [2, 4]]\n```\n\nCalculate the permutations of a list:\n\n```js\nimport { permutations } from 'fkit'\npermutations('abc') // ['abc', 'bac', 'cba', 'bca', 'cab', 'acb']\n```\n\nCheck out some more examples:\n\n* [Functions](http://codepen.io/nullobject/pen/dbAkl?editors=001)\n* [Strings](http://codepen.io/nullobject/pen/hnDEe?editors=001)\n* [Arrays](http://codepen.io/nullobject/pen/vbcCr?editors=001)\n* [Objects](http://codepen.io/nullobject/pen/rKszh?editors=001)\n* [Branching](http://codepen.io/nullobject/pen/LdtDK?editors=001)\n\n## Licence\n\nFKit is licensed under the MIT licence. See the\n[LICENCE](https://github.com/nullobject/fkit/blob/master/LICENCE.md) file for\nmore details.\n","funding_links":[],"categories":["JavaScript","Libraries"],"sub_categories":["[Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullobject%2Ffkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullobject%2Ffkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullobject%2Ffkit/lists"}