🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@fxts/core

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fxts/core

A functional library for TypeScript/JavaScript programmers.

latest
Source
npmnpm
Version
1.26.0
Version published
Weekly downloads
31K
-2.05%
Maintainers
2
Weekly downloads
 
Created
Source
FxTS Logo

FxTS

Build Status npm version License

FxTS is a functional programming library for TypeScript.

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.

Keywords

fp

FAQs

Package last updated on 19 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts