doctyped

1.3.4 • Public • Published

doctyped · Build Status

Description

Auto-generate Flow or TypeScript types from API documentation descriptions.

Installing

yarn add -D doctyped or npm install --save-dev doctyped

Usage

Node

import doctyped from 'doctyped/doctyped';

const types = doctyped('/path/to/descriptor');

The above code will generate an object containing all models and properties defined by the swagger descriptor. This is useful if we want to run checks against types in the runtime environment. Optionally, we can pass an options object { output: '/someoutput/path' }as the second argument that will generate js.flow files.

CLI

yarn doctyped -a <flow-or-ts> -o <destination-directory> <api-url>

/doctyped/

    Package Sidebar

    Install

    npm i doctyped

    Weekly Downloads

    1

    Version

    1.3.4

    License

    MIT

    Unpacked Size

    20.1 kB

    Total Files

    21

    Last publish

    Collaborators

    • nulldivision