# justo-sync

> A synchronizer.

Latest version **0.1.1** (published 2016-05-02) · 0 weekly downloads

## Install

```sh
npm install justo-sync
pnpm add justo-sync
yarn add justo-sync
bun add justo-sync
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-05-02 |
| First published | 2016-05-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 5.0.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Justo Labs |
| Maintainers | justojs |

## Links

- npm: https://www.npmjs.com/package/justo-sync
- Repository: https://github.com/justojs/justo-sync
- Homepage: http://justojs.org
- Issues: https://github.com/justojs/justo-sync/issues
- npm.io page: https://npm.io/package/justo-sync

## Dependencies (1)

- [deasync](https://npm.io/package/deasync.md) *

## Recent versions

- 0.1.1 (latest) — 2016-05-02
- 0.1.0 — 2016-05-02

## README

[![NPM version](http://img.shields.io/npm/v/justo-sync.svg)](https://www.npmjs.org/package/justo-sync)
[![Build Status](https://travis-ci.org/justojs/justo-sync.svg?branch=master)](https://travis-ci.org/justojs/justo-sync)
[![Dependency Status](https://david-dm.org/justojs/justo-sync.svg)](https://david-dm.org/justojs/justo-sync)
[![devDependency Status](https://david-dm.org/justojs/justo-sync/dev-status.svg)](https://david-dm.org/justojs/justo-sync#info=devDependencies)

A synchronizer.

*Proudly made with ♥ in Valencia, Spain, EU.*

## Install

```
npm install justo-sync
```

## Use

```
const sync = require("justo-sync");
```

The package is a function to run an asynchronous function synchronously.
This function is:

```
function sync(fn : function(done)) : object
```

`sync` runs the given function and it returns the value returned by the
asynchronous function. The asynchronous function must run its `done` parameter
when ended:

```
done()               //sync() returns undefined
done(error)          //sync() throws error
done(undefined, res) //sync() returns the result
```

## Examples

```
const sync = require("justo-sync");

//sync() will finish throwing an error
sync(function(done) {
  done(new Error("This is the error message."));
});

//sync() will finish returning a value
sync(function(done) {
  done(undefined, "the value to return by sync()");
});
```

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