Back to directory
typelevel avatar

fs2

Compositional, streaming I/O library for Scala. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/typelevel/fs2.git

2,451

Stars

635

Forks

78

Watchers

NOASSERTION

License

FS2: Functional Streams for Scala

Continuous Integration Discord Maven Central

Overview

FS2 is a library for purely functional, effectful, and polymorphic stream processing library in the Scala programming language. Its design goals are compositionality, expressiveness, resource safety, and speed. The name is a modified acronym for Functional Streams for Scala (FSS, or FS2).

FS2 is available for Scala 2.12, Scala 2.13, Scala 3, and Scala.js and Scala Native. FS2 is built upon two major functional libraries for Scala, Cats, and Cats-Effect. Regardless of those dependencies, FS2 core types (streams and pulls) are polymorphic in the effect type (as long as it is compatible with cats-effect typeclasses), and thus FS2 can be used with other effect libraries, such as Monix.

Getting Started

Quick links:

Documentation and getting help

  • There are Scaladoc API documentations for the library.
  • The official guide is a good starting point for learning more about the library.
  • The documentation page is intended to serve as a list of all references, including conference presentation recordings, academic papers, and blog posts, on the use and implementation of fs2.
  • The FAQ has frequently asked questions. Feel free to open issues or PRs with additions to the FAQ!
  • Also feel free to come discuss and ask/answer questions in the Typelevel Discord channel and/or on StackOverflow using the tag FS2. Discord will generally get you a quicker answer.

Projects using FS2

You can find a list of libraries and integrations with data stores built on top of FS2 here: https://fs2.io/#/ecosystem.

If you have a project you'd like to include in this list, please open a PR or let us know in the Discord channel and we'll add a link to it.

Acknowledgments

YourKit

Special thanks to YourKit for supporting this project's ongoing performance tuning efforts with licenses to their excellent product.

Code of Conduct

See the Code of Conduct.

Releases

Cats Effect 3.7.0 and Scala Native 0.5 support with real multi-threading on Scala Native! Features

Use virtual threads when possible for JdkUnixSockets by @onsah in #3548 Implement Socket#sendFile by...

v3.13.0-M8

Pre-release

Jan 6, 2026

Download .zip

Fixes

Stream merge blocking downstream work. by @AdamChlupacek in #3610

Features

Unify TCP/UDP and UnixSocket APIs by @mpilquist in #3563 Added Cats-Effect selector-based Datagramsocket implementat...

Fixes

fix: GHSA-rrw2-px9j-qffj remediation backported to 2.5.x by @augi in #3624

Build

Migrate 2.5. to sbt-typelevel to get publication working again by @mpilquist in #3625

New Contributors

@augi...

Contains the fix for GHSA-rrw2-px9j-qffj. All users of TLS support on the JVM should upgrade to 3.12.1+ or 3.13.0-M7+. Bugfixes

Backport #3591 by @mtomko in #3603

Full Changelog: v3.12.1...v3.12.2

v3.13.0-M7

Pre-release

Sep 4, 2025

Download .zip

Contains the fix for GHSA-rrw2-px9j-qffj. All users of TLS support on the JVM should upgrade to 3.12.1+ or 3.13.0-M7+. Bugfixes

Fix spinloop bug in TLSEngine by @mpilquist in #3599 Fix for #3590 by @...