@tomer/fn

A tree-shakeable functional programming library with lazy sync, async, and concurrent iteration.

Usage no npm install needed!

<script type="module">
  import tomerFn from 'https://cdn.skypack.dev/@tomer/fn';
</script>

README

fn

A tree-shakeable functional programming library with lazy sync, async, and concurrent iteration.

Install

$ npm i @tomer/fn

Usage

This package is still under active development. Until I have better documentation take a look at the following example:

import { filter, join, map, pipe, repeat, take } from '@tomer/fn'

const string = 'rainbows! And unicorns!!!'

//=> RAINBOWS AND UNICORNS!!! RAINBOWS AND UNICORNS!!! RAINBOWS AND UNICORNS!!
console.log(
  pipe(
    string,
    filter(c => c !== '!'),
    map(c => c.toUpperCase()),
    join(''),
    repeat,
    map(s => `${s}!!!`),
    take(3),
    join(' ')
  )
)

Everything is lazy!

Contributing

Stars are always welcome!

For bugs and feature requests, please create an issue.

For pull requests, please read the contributing guidelines.

License

Apache 2.0

This is not an official Google product.