# just-try

> Functional try-catch

Latest version **2.1.0** (published 2018-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install just-try
pnpm add just-try
yarn add just-try
bun add just-try
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-10-02 |
| First published | 2016-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hoàng Văn Khải |
| Maintainers | khai96_ |

## Links

- npm: https://www.npmjs.com/package/just-try
- Repository: https://github.com/ksxnodemodules/just-try
- Homepage: https://github.com/ksxnodemodules/just-try#readme
- Issues: https://github.com/ksxnodemodules/just-try/issues
- npm.io page: https://npm.io/package/just-try

## Recent versions

- 2.1.0 (latest) — 2018-10-02
- 2.0.2 — 2018-10-02
- 2.0.1 — 2016-05-04
- 2.0.0 — 2016-05-03
- 1.1.1 — 2016-04-16
- 1.1.0 — 2016-03-27
- 1.0.0 — 2016-03-21
- 0.0.0 — 2016-03-21

## README

# just-try

## Requirements

* Node >= 6.0.0

## Usage

### Function `tryCatch`

```javascript
var tryCatch = require('just-try');
var valorerr = tryCatch(act, onerror, onsuccess); // return value of onerror or onsuccess
dosomething(valorerr);
```

### Function `tryCatch.tuple`

```javascript
var tuple = require('just-try').tuple;
var errandval = tuple(act); // an array of [error, value]
dosomething(errandval);
```

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