Socket
Book a DemoInstallSign in
Socket

@greenlabs/ppx-spice

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@greenlabs/ppx-spice

ReScript PPX which generate the (polymorphic) variant (de)serializer

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
781
-7.02%
Maintainers
5
Weekly downloads
 
Created
Source

Spice

A ReScript PPX which generates the (polymorphic) variant (de)serializer.

This ppx is highly influenced by Decco and developed with forking the source codes of Decco.

Example

@spice
type t = | @spice.as(`하나`) One | @spice.as(`second`) Two

// automatically generated
let t_encode = ...

// automatically generated
let t_decode = ...

let encoded = One->t_encode // `하나`

let decoded = `second`->t_decode // Belt.Result.Ok(Two)

Install

// bsconfig.json
"bs-dependencies": [
  ...,
  "@greenlabs/ppx-spice"
],
"ppx-flags": [
  ...,
  "@greenlabs/ppx-spice/ppx"
],

Development

  • Install dependencies
cd src
esy install
  • Build
(make sure in /src directory)
esy build
  • Test
cd test

(install dependencies)
yarn

(build --watch)
yarn res:clean && yarn res:watch

(run test --watch)
yarn test:watch

Keywords

ReScript

FAQs

Package last updated on 26 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts