metarpheus-io-ts

metarpheus to io-ts

Usage no npm install needed!

<script type="module">
  import metarpheusIoTs from 'https://cdn.skypack.dev/metarpheus-io-ts';
</script>

README

metarpheus-io-ts

Generate static and runtime (io-ts) domain models interpreting metarpheus output.

Install

npm i metarpheus-io-ts

Usage

metarpheus-io-ts -i path/to/input.json -c path/to/config.json -o path/to/output.ts

Usage from node

import { getModels, getRoutes } from 'metarpheus-io-ts'

const source = ...
const models: string = getModels(source.models, modelsOptions)
const routes: string = getRoutes(source.routes, source.models, routesOptions)