# fputils

> some common util methods

Latest version **1.2.10** (published 2022-08-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install fputils
pnpm add fputils
yarn add fputils
bun add fputils
```

## 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.2.10 |
| Published | 2022-08-05 |
| First published | 2017-07-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 92.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Honza Smid |
| Maintainers | smidhonza, kolebjak, dtourek |
| Keywords | fp, utils |

## Links

- npm: https://www.npmjs.com/package/fputils
- Repository: https://github.com/smidhonza/fputils
- Homepage: https://github.com/smidhonza/fputils#readme
- Issues: https://github.com/smidhonza/fputils/issues
- npm.io page: https://npm.io/package/fputils

## Recent versions

- 1.2.10 (latest) — 2022-08-05
- 1.2.9 — 2022-08-05
- 1.2.8 — 2021-10-01
- 1.2.7 — 2021-08-11
- 1.2.6 — 2021-08-02
- 1.2.5 — 2021-07-27
- 1.2.4 — 2021-06-21
- 1.2.3 — 2021-06-21
- 1.2.2 — 2021-06-18
- 1.2.1 — 2021-06-18
- 1.2.0 — 2021-06-18
- 1.1.6 — 2021-03-18
- 1.1.5 — 2021-03-18
- 1.1.4 — 2021-03-10
- 1.1.3 — 2021-03-10
- … 13 more at https://npm.io/package/fputils/versions

## README

# FP utils

A bunch of useful utility functions


## Examples

### Either

```typescript
import { either, Either, Right, Left } from 'fputils';

// define fetch function, this function does not throw, but returns Either data or error instead
const get = <T>(url: string): Either<Error, T> => new Promise(async resolve => {
    try {
        return resolve(Right(await fetch(url)))
    } catch (error) {
        return resolve(Left(error))
    }
});

// either usage
either((error) => {
    console.error({ error })
}, (result) => {
    console.log({ result })
}, await get<string[]>('https://api'));

```

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