# functional-tools

> Fully typed utility functions to write Typescript in a more functional style

Latest version **1.1.2** (published 2022-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install functional-tools
pnpm add functional-tools
yarn add functional-tools
bun add functional-tools
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-11-22 |
| First published | 2022-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dmailloux |
| Maintainers | dmailloux |
| Keywords | functional, utils, tools, fp, functional programming |

## Links

- npm: https://www.npmjs.com/package/functional-tools
- Repository: https://github.com/dmailloux/functional-tools
- Homepage: https://github.com/dmailloux/functional-tools#readme
- Issues: https://github.com/dmailloux/functional-tools/issues
- npm.io page: https://npm.io/package/functional-tools

## Recent versions

- 1.1.2 (latest) — 2022-11-22
- 1.1.1 — 2022-11-22
- 1.0.5 — 2022-08-12
- 1.0.4 — 2022-08-12
- 1.0.3 — 2022-08-12
- 1.0.2 — 2022-08-12
- 1.0.1 — 2022-08-12
- 1.0.0 — 2022-08-12

## README

# Functional Tools

Fully typed utility functions to write Typescript in a more functional style

## Installation

```bash
npm i --save functional-tools
```

```bash
yarn add functional-tools
```

## Basic Example

## Evaluate

```ts
import { evaluate } from "./evaluate";

const startsWithH = (x: string) => x[0] === "h";

const hasAComma = (x: string) => x.includes(",");

const result = evaluate("hello, world", startsWithH, hasAComma);

console.log(result);
// true
```

### Pipeline Function

```ts
import { pipeline } from "functional-tools";

const append = (x: string) => (y: string) => y + x;

const capitalize = (x: string) => x.toUpperCase();

const removeWhitespace = (x: string) => x.replace(/ /g, "");

const helloWorld = pipeline("  hello", append(", world! "), capitalize, removeWhitespace);

console.log(helloWorld);
// "HELLO,WORLD!"
```

---
_Source: https://npm.io/package/functional-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
