# refmt

> refmt packaged as a JS library

Latest version **1.13.7-1** (published 2017-08-24) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## 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.13.7-1 |
| Published | 2017-08-24 |
| First published | 2017-08-23 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | anmonteiro, rrdelaney |
| Keywords | reason, reasonml, refmt |

## Links

- npm: https://www.npmjs.com/package/refmt
- Repository: https://github.com/reasonml-community/refmt-js
- Homepage: https://github.com/reasonml-community/refmt-js#readme
- Issues: https://github.com/reasonml-community/refmt-js/issues
- npm.io page: https://npm.io/package/refmt

## Recent versions

- 1.13.7-1 (latest) — 2017-08-24
- 1.13.7 — 2017-08-24
- 0.0.1 — 2017-08-23

## README

# refmt-js

refmt packaged as a JS library

## Installation

```
npm i refmt
```

## Usage

```js
const refmt = require('refmt')

const myReasonMLCode = fs.readFileSync('file.re')
const formattedCode = refmt(myReasonMLCode)
```

## API

#### `refmt(source: string, sourceLang: string?, sourceType: string?, targetLang: string?): string`

The `refmt` function will output styled ReasonML or OCaml source code. The only required param is
`source`, the input source code. `sourceLang` specifies the input language, defaulted to Reason.
Specify `'RE'` for Reason, or `'ML'` for OCaml input. `sourceType` specifies the source code type,
either `'implementation'` or `'interface'`, defaults to implementation. `targetLang` specifies the
output language, `'RE'` for Reason, or `'ML'` for OCaml, defaults to Reason.

## Source Maps

The distibution also includes a sourcemap for the compiled JS. To enable Node to use the provided source
map, please use [`source-map-support`](https://github.com/evanw/node-source-map-support).

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