Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmurphy authored May 2, 2024
1 parent 5cadcf9 commit 4afcb57
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@

Decco is lazily maintained by it users, but it's not being actively developed, since its feature set is complete enough for general production use. If you find a major bug that you need fixed, it'll probably be your job to fix it. 💪

## How do I install it?

1. Install package

```
npm i @rescript-labs/decco
```

2. Update your `rescript.json` (or bsconfig.json if you haven't changed its name)

```json
{
...,
"bs-dependencies": [ "@rescript-labs/decco" ],
"ppx-flags": [ "@rescript-labs/decco/ppx" ],
...
}
```

Adding `decco/ppx` to `ppx-flags` will enable the PPX. Adding decco to `bs-dependencies` is required because the code generated by the PPX references the `Decco` module.

## Compatibility

Decco 2.0.0 and above work with ReScript 11 in uncurried mode. If you need to use Decco with an older version of ReScript, install decco version `1.6.0`

If you need to use decco with BuckleScript 5, install `@ryb73/decco` version ^0.1.0 by [following the old ReadMe here](https://github.com/reasonml-labs/decco/blob/0452fc42fa4cd4230d394c718e7f62a0384ce045/README.md).


## What is it?

A Rescript PPX which generates JSON serializers and deserializers for user-defined types.
Expand Down Expand Up @@ -53,33 +81,6 @@ let { s, i, o, complex, f, otherKey, magic } =
mytype_decode(encoded)->Belt.Result.getExn;
```

## How do I install it?

1. Install package

```
npm i decco
```

2. Update your `rescript.json` (or bsconfig.json if you haven't changed its name)

```json
{
...,
"bs-dependencies": [ "decco" ],
"ppx-flags": [ "decco/ppx" ],
...
}
```

Adding `decco/ppx` to `ppx-flags` will enable the PPX. Adding decco to `bs-dependencies` is required because the code generated by the PPX references the `Decco` module.

## Compatibility

Decco 2.0.0 and above work with ReScript 11 in uncurried mode. If you need to use Decco with an older version of ReScript, install decco version `1.6.0`

If you need to use decco with BuckleScript 5, install `@ryb73/decco` version ^0.1.0 by [following the old ReadMe here](https://github.com/reasonml-labs/decco/blob/0452fc42fa4cd4230d394c718e7f62a0384ce045/README.md).

## How do I use it?

See the test folder in this repo for some examples.
Expand Down

0 comments on commit 4afcb57

Please sign in to comment.