# js-of-reason

> This module converts a snippet of reasonML to javascript.

Latest version **1.0.3** (published 2018-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-of-reason
pnpm add js-of-reason
yarn add js-of-reason
bun add js-of-reason
```

## 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 | 1.0.3 |
| Published | 2018-07-30 |
| First published | 2018-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | leonardo Sao Thiago |
| Maintainers | leoancap |
| Keywords | javascript, reason, BuckleScript |

## Links

- npm: https://www.npmjs.com/package/js-of-reason
- npm.io page: https://npm.io/package/js-of-reason

## Dependencies (1)

- [bs-platform](https://npm.io/package/bs-platform.md) ^4.0.2

## Recent versions

- 1.0.3 (latest) — 2018-07-30
- 1.0.2 — 2018-07-30
- 1.0.1 — 2018-07-30
- 1.0.0 — 2018-07-30

## README

# Basic Reason Template

This module converts a snippet of reasonML to javascript.

# Example

```
const jsOfReason = require("js-of-reason")
const reasonCode = `let add = (a,b) => {
  a + b;
}`

jsOfReason(reasonCode, (error, jsCode) => {
  if(error){
    console.log(error)
  } else {
    console.log(jsCode)         // function add(a, b) {
                                //   return a + b | 0;
                                // }
  }
})

const codeWithError = `let add = (a,b) => {
  a + b + "2";
}`

jsOfReason(codeWithError, (error, jsCode) => {
  if(error){
    console.log(error)          // <type error>
                                //   1 │ let add = (a,b) => {
                                //   2 │   a + b + "2";
                                //   3 │ }
                                //   This has type:
                                //     string
                                //   But somewhere wanted:
                                //     int
  } else {
    console.log(jsCode)
  }
})
```

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