marpple/FxTS

A functional programming library for TypeScript/JavaScript

TypeScript

1,169

611 commits

updated Aug 29, 2026

See the code

README

FxTS Logo

FxTS

Build Status npm version License

FxTS is a functional programming library for TypeScript.

Why FxTS?

FxTSlodashNative (Array + Iterator Helpers)
Lazy evaluation✅🔶 _.chain only✅ ES2025
AsyncIterable pipelines✅❌❌ (proposal stage)
Concurrency control with backpressure✅ concurrentPool❌❌
Curried, data-last composition (pipe)✅🔶 lodash/fp❌
Promise-unwrapping composition (pipe infers Awaited values)✅❌❌
Early termination across async work (take)✅❌🔶 sync only
Literal-preserving inference (Record<"a"…>)✅❌—
Deep utils (isEqual, cloneDeep, merge)✅✅❌

Migrating from p-limit/p-map? See the migration guide.

Installation

npm install @fxts/core

Usage

Use pipe for function composition or fx for method chaining:

import { each, filter, fx, map, pipe, range, take } from "@fxts/core";

pipe(
  range(10),
  map((a) => a + 10),
  filter((a) => a % 2 === 0),
  take(2),
  each((a) => console.log(a)),
);

// chaining
fx(range(10))
  .map((a) => a + 10)
  .filter((a) => a % 2 === 0)
  .take(2)
  .each((a) => console.log(a));

Usage (concurrent)

Handle multiple async operations in parallel with concurrent:

import { concurrent, countBy, flat, fx, map, pipe, toAsync } from "@fxts/core";

// maybe 1 seconds api
const fetchWiki = (page: string) =>
  fetch(`https://en.wikipedia.org/w/api.php?action=parse&page=${page}`);

const countWords = async (concurrency: number) =>
  pipe(
    ["html", "css", "javascript", "typescript"],
    toAsync,
    map(fetchWiki),
    map((res) => res.text()),
    map((words) => words.split(" ")),
    flat,
    concurrent(concurrency),
    countBy((word) => word),
  );

await countWords(); // 4 seconds
await countWords(2); // 2 seconds

Documentation

For more information, visit fxts.dev.

For LLM-friendly documentation, see llms.txt.

Contributing

We welcome contributions from everyone in the community. Please read our Contributing Guide.

License

Apache License 2.0 © Marpple. See LICENSE for details.

concurrency
fp
javascript
lazy
typescript

marpple/FxTS

A functional programming library for TypeScript/JavaScript

TypeScript

1,169

611 commits

updated Aug 29, 2026

See the code

README

FxTS Logo

FxTS

Build Status npm version License

FxTS is a functional programming library for TypeScript.

Why FxTS?

FxTSlodashNative (Array + Iterator Helpers)
Lazy evaluation✅🔶 _.chain only✅ ES2025
AsyncIterable pipelines✅❌❌ (proposal stage)
Concurrency control with backpressure✅ concurrentPool❌❌
Curried, data-last composition (pipe)✅🔶 lodash/fp❌
Promise-unwrapping composition (pipe infers Awaited values)✅❌❌
Early termination across async work (take)✅❌🔶 sync only
Literal-preserving inference (Record<"a"…>)✅❌—
Deep utils (isEqual, cloneDeep, merge)✅✅❌

Migrating from p-limit/p-map? See the migration guide.

Installation

npm install @fxts/core

Usage

Use pipe for function composition or fx for method chaining:

import { each, filter, fx, map, pipe, range, take } from "@fxts/core";

pipe(
  range(10),
  map((a) => a + 10),
  filter((a) => a % 2 === 0),
  take(2),
  each((a) => console.log(a)),
);

// chaining
fx(range(10))
  .map((a) => a + 10)
  .filter((a) => a % 2 === 0)
  .take(2)
  .each((a) => console.log(a));

Usage (concurrent)

Handle multiple async operations in parallel with concurrent:

import { concurrent, countBy, flat, fx, map, pipe, toAsync } from "@fxts/core";

// maybe 1 seconds api
const fetchWiki = (page: string) =>
  fetch(`https://en.wikipedia.org/w/api.php?action=parse&page=${page}`);

const countWords = async (concurrency: number) =>
  pipe(
    ["html", "css", "javascript", "typescript"],
    toAsync,
    map(fetchWiki),
    map((res) => res.text()),
    map((words) => words.split(" ")),
    flat,
    concurrent(concurrency),
    countBy((word) => word),
  );

await countWords(); // 4 seconds
await countWords(2); // 2 seconds

Documentation

For more information, visit fxts.dev.

For LLM-friendly documentation, see llms.txt.

Contributing

We welcome contributions from everyone in the community. Please read our Contributing Guide.

License

Apache License 2.0 © Marpple. See LICENSE for details.

concurrency
fp
javascript
lazy
typescript

Significant stargazers

Kagami Sascha Rosylight

310 followers · starred Apr 2025

Jihyeon Kim (김지현)

924 followers · starred Apr 2026

Dominik Żegleń

74 followers · starred Dec 2022

jgjgill

42 followers · starred Jan 2025