{"id":18463581,"url":"https://github.com/uinix-js/uinix-fp","last_synced_at":"2025-10-03T23:09:01.724Z","repository":{"id":57141163,"uuid":"353247856","full_name":"uinix-js/uinix-fp","owner":"uinix-js","description":"FP utilities for authoring common JS programs in functional form.","archived":false,"fork":false,"pushed_at":"2022-09-28T06:18:53.000Z","size":165,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T13:49:03.247Z","etag":null,"topics":["fp","ui","uinix","utility"],"latest_commit_sha":null,"homepage":"https://uinix.dev","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/uinix-js.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["uinix-js"]}},"created_at":"2021-03-31T06:17:42.000Z","updated_at":"2024-08-16T08:27:06.000Z","dependencies_parsed_at":"2022-09-05T04:00:15.293Z","dependency_job_id":null,"html_url":"https://github.com/uinix-js/uinix-fp","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinix-js%2Fuinix-fp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinix-js%2Fuinix-fp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinix-js%2Fuinix-fp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uinix-js%2Fuinix-fp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uinix-js","download_url":"https://codeload.github.com/uinix-js/uinix-fp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247796328,"owners_count":20997552,"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","ui","uinix","utility"],"created_at":"2024-11-06T09:07:19.875Z","updated_at":"2025-10-03T23:08:56.673Z","avatar_url":"https://github.com/uinix-js.png","language":"JavaScript","funding_links":["https://github.com/sponsors/uinix-js"],"categories":[],"sub_categories":[],"readme":"# uinix-fp\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n\n[FP] utilities for authoring common JS programs in functional form.\n\n---\n\n## Contents\n- [Install](#install)\n- [Use](#use)\n- [API](#api)\n- [Project](#project)\n  - [Goals](#goals)\n  - [Types](#types)\n  - [Version](#version)\n  - [Contribute](#contribute)\n  - [Related](#related)\n  - [License](#license)\n\n## Install\n\n\nThis package is [ESM-only].\n\nInstall in Node 12+ with [npm]:\n\n```sh\nnpm install uinix-fp\n```\n\nInstall in [Deno] with [esm.sh]:\n```js\nimport {...} from 'https://esm.sh/uinix-fp';\n```\n\nInstall in browsers with [esm.sh]:\n```html\n\u003cscript type=\"module\"\u003e\n  import {...} from 'https://esm.sh/uinix-fp';\n\u003c/script\u003e\n```\n\nYou may also install specific [packages] individually.\n\n```sh\nnpm install uinix-fp-i\nnpm install uinix-fp-map\nnpm install uinix-fp-noop\nnpm install uinix-fp-pipe\n...\n```\n\n\u003e **Note:** uinix-fp is tree-shakeable and we recommend simply installing the main package if your build supports [tree shaking].\n\n## Use\n\nThe following example shows usage of some uinix-fp programs supporting [pointfree] and [currying] ways to express common JS data transformations in a pipeline.\n\n```js\nimport {\n  filter,\n  isTruthy,\n  map,\n  pipe,\n  props\n} from 'uinix-fp';\n\nconst greet = x =\u003e 'Hi ' + x;\n\nconst exclaim = x =\u003e x + '!';\n\nconst filterTruthy = filter(isTruthy); // curried\n\nconst data = [\n  null,\n  {user: {firstName: 'Jesse'}},\n  null,\n  {user: {firstName: 'Walter'}},\n  ...\n];\n\nconst pipeline = pipe([\n  filterTruthy, // [{user: {firstName: 'Jesse'}}, {user: {firstName: 'Walter'}}, ...]\n  map(props('user.firstName')), // ['Jesse', 'Walter', ...]\n  map(greet), // ['Hi Jesse', 'Hi Walter', ...]\n  map(exclaim), // ['Hi Jesse!', 'Hi Walter!', ...]\n])(data);\n```\n\nuinix-fp is unopinionated and you you can express your code appropriately for your functional style and needs. The following pipeline is equivalent to the previous pipeline.\n\n```js\nconst shoutFirstName = pipe([\n  props('user.firstName'),\n  greet,\n  exclaim,\n]);\n\nconst pipeline = pipe([\n  filterTruthy,\n  map(shoutFirstName),\n])(data)\n```\n\n## API\n\nuinix-fp exports the following identifiers:\n- [`filter`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-filter)\n- [`filterEntries`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-filter-entries)\n- [`i`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-i)\n- [`isPlainObject`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-is-plain-object)\n- [`isTruthy`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-is-truthy)\n- [`k`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-k)\n- [`map`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-map)\n- [`mapEntries`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-map-entries)\n- [`merge`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-merge)\n- [`noop`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-noop)\n- [`pipe`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-pipe)\n- [`prop`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-prop)\n- [`props`](https://github.com/uinix-js/uinix-fp/tree/main/packages/uinix-fp-props)\n\nThere are no default exports.\n\nAPIs are explorable via [JSDoc]-based [Typescript] typings accompanying the source code.\n\n## Project\n\n### Goals\nuinix-fp is fundamentally just a *simple JS library of utilities*.  It aims to be JS-first and avoid opinionated domain-specific APIs.\n\nuinix-fp programs follow the [Unix philosophy], with each program maintaining simple and clear responsibilities, while remaining interoperable with other program and most importantly with core JS.\n\nStrict formalization of FP principles and typings should not impede on the primary goal of providing a minimal set of utilities to help express common JS programs in functional form.  If you are looking for a formal and rigorous set of FP utilities, please explore other libraries such as [sanctuary] and [fp-ts].\n\n## Types\n\nuinix-fp ships with [Typescript] declarations, compiled and emitted when installed. The source code is pure Javascript.\n\n### Version\nuinix-fp adheres to [semver] starting at 1.0.0.\n\n**Note:** uinix-fp is a *JS-first* project.  [Typescript] types are provided as a supplementary convenience for the TS community.  Changes in typings will always be treated as [semver] fixes.\n\n### Contribute\nuinix-fp is a collection of smaller FP utilities managed under a monorepo of [packages].\n\nInstall dependencies with `npm i` and run tests with `npm test`.  You can also run other NPM scripts (e.g. `lint`) from the root of the monorepo.\n\n### Related\n- [uinix-js][uinix-js]\n- [sanctuary][sanctuary]\n- [fp-ts][fp-ts]\n- [combinator-js][combinator-js]\n\n### License\n\n[MIT][license] © [Chris Zhou][author]\n\n\u003c!-- project --\u003e\n[author]: https://github.com/chrisrzhou\n[license]: https://github.com/uinix-js/uinix-fp/blob/main/license\n[build]: https://github.com/uinix-js/uinix-fp/actions\n[build-badge]: https://github.com/uinix-js/uinix-fp/workflows/main/badge.svg\n[coverage]: https://codecov.io/github/uinix-js/uinix-fp\n[coverage-badge]: https://img.shields.io/codecov/c/github/uinix-js/uinix-fp.svg\n[downloads]: https://www.npmjs.com/package/uinix-fp\n[downloads-badge]: https://img.shields.io/npm/dm/uinix-fp.svg\n[bundle-size]: https://bundlephobia.com/result?p=uinix-fp\n[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/uinix-fp.svg\n[packages]: https://github.com/uinix-js/uinix-fp/tree/main/packages/\n[uinix-js]: https://github.com/uinix-js/\n\n\u003c!-- defs --\u003e\n[combinator-js]: https://github.com/benji6/combinators-js\n[currying]: https://en.wikipedia.org/wiki/Currying\n[deno]: https://deno.land/\n[esm.sh]: https://esm.sh/\n[ESM-only]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n[fp]: https://en.wikipedia.org/wiki/Functional_programming\n[fp-ts]: https://github.com/gcanti/fp-ts\n[jsdoc]: https://github.com/jsdoc/jsdoc\n[npm]: https://docs.npmjs.com/cli/v8/commands/npm-install\n[pointfree]: https://en.wikipedia.org/wiki/Tacit_programming\n[sanctuary]: https://github.com/sanctuary-js/sanctuary\n[semver]: https://semver.org/\n[tree shaking]: https://webpack.js.org/guides/tree-shaking/\n[typescript]: https://github.com/microsoft/TypeScript\n[unix philosophy]: https://en.wikipedia.org/wiki/Unix_philosophy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuinix-js%2Fuinix-fp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuinix-js%2Fuinix-fp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuinix-js%2Fuinix-fp/lists"}